Let $f:G \to H$ be a a group homomorphism such that for any two groups $H_1 , H_2$ , and any homomorphisms $g_1 : H \to H_1 , g_2 :H \to H_2$ , $g_1 \circ f = g_2 \circ f \implies g_1=g_2 $ ; then is it true that $f$ is surjective ?
Yes, it is a result of Schreier, but it is by no means elementary, see for instance this discussion of Arturo Magidin.
Yes this is true: consider $f$ is not surjective, i.e., $\forall g\in G, \exists h\in H$ such that $f(g) \neq h$. Then you can construct two group homomorphisms $g_1, g_2$ such that $g_1 \circ f = g_2 \circ f$ but $g_1 \neq g_2$ (which gives you your contradiction). I'll leave that construction up to you.