What functions $f: A \to B$ and $g: B \to A$, satisfy a restriction such that $f$ is not invertible but $f \circ g=id_B$? I am caught up on the notation of $id_B$. I'm thinking that $f=x^2$, or something along those lines, but not so sure as to what $g$ may be. 

Hint: If $f\circ g=\operatorname{id}_B$ then $g$ in injective and $f$ is surjective.
