Let $f: X \rightarrow Y$ and $g: Y \rightarrow X$
If $f \circ g = id_y$, is $f$ injective?
$f \circ g = id_y$
$\equiv g^{-1} \circ g = id_y \Rightarrow $g is leftinverse and by definition injective
$f \circ g = id_y$
$\equiv f \circ f^{-1}=id_y \Rightarrow$ f is rightinverse and by definition surjective
So $f$ is surjective and not injective
Question: Is that or do I miss something here?