Composition of functions using injectivity

54 Views Asked by At

I am really stuck on the following question so any help would be appreciated.

a) Give an example of function f: A -> B and g: B -> A such that f ∘ g (y) = y for all y in B but where f is not injective.

b) Let f: A -> B and g: B -> A be two functions such that g ∘ f (x) = x for all x in A. Show that f is injective and f ∘ g(y) = y for all y in f(A).

I am really confused and I do not know how to work it out. Thank you!!