I have a problem I need help with: If $X,Y$ are $\neq$ non-empty sets and f: X$\rightarrow$Y a transformation. Prove that the following statements are equivalent: (i) f is surjective (ii) There is a transformation g: Y$\rightarrow$ X so that f $\circ$ g = $I_Y$ ( Identity of Y).
My solution is the following: Let c $\in$ C be arbitrary. So that there exists an a with c = f(g(a)). Let's define b := g(a) so that there is a b $\in$ B with g(b) = f(g(a)) = c. Any hints or solutions guiding to the right direction I much appreciate.