let f: ℤ→ ℤ and g: ℤ → ℤ be functions defined by f(x) = 3x + 1 and g(x) = |_x/2_|.

(a) Is f o g one-to-one? prove
(b) is f o g unto? prove
(c) Is g o f one-to-one?
(d) Is g o f unto?

Thank you for your help.

2 answers

clearly g is not 1-1. For example, g(3) = g(2)

Also, it is clear that both f and g are onto.

Some good discussion can be found here:

http://www.csee.umbc.edu/~stephens/203/PDF/7-3.pdf

f◦g = 3g+1 = 3⌊x/2⌋+1
g◦f = ⌊f/2⌋ = ⌊(3x+1)/2⌋

g◦f is clearly 1-1, since consecutive values of x produce 3x+1 which are separated by more than 2, making their floors distinct.
Oops. g◦f and f◦g are not onto, since

(g◦f)(0) = 0
(g◦f)(1) = 2
And there is no x such that (g◦f)(x) = 1

(f◦g)(0) = 1
(f◦g)(1) = 1
(f◦g)(2) = 4
and there is no (f◦g)(x) = 2