If $g \circ f$ is the identity function, then which of $f$ and $g$ is onto and which is one-to-one? [closed]

If it is just a matter of remembering what the right conclusion is, here's the picture I always use to remember: $$\begin{array}{rcl} &\bullet &\\ &&\searrow\\ \bullet\rightarrow& \bullet & \rightarrow\bullet\\ X\quad\quad&Y&\quad\quad Z \end{array}$$ The compositum is one-to-one and onto: the first function is one-to-one but not onto; the second function is onto, but not one-to-one.

So: if a compositum is one-to-one, the first function applied is one-to-one. If a compositum is onto, then the second function applied is onto.

If $g\circ f = \mathrm{id}$, then the first function ($f$) is one-to-one, and the second function ($g$), is onto.

If it is a matter of proving that the first function is one-to-one and the second function is onto, well, you'd need a proof. An example does not suffice.


HINT: $$\begin{array}{}&&\bullet&&\\ &&&\searrow&\\ \bullet&\to&\bullet&\to&\bullet\\ X&f&Y&g&X \end{array}$$


You already have several answers which can help you remember the theorem. If you're looking for a proof (and have problems with showing it yourself), you might try to have a look at these links:

  • http://www.proofwiki.org/wiki/Injection_if_Composite_is_an_Injection
  • http://www.proofwiki.org/wiki/Surjection_if_Composite_is_a_Surjection

or these questions/answers:

  • If g(f(x)) is one-to-one (injective) show f(x) is also one-to-one (given that...)
  • Surjection on composed function?
  • Injective and Surjective Functions

More general results are here:

  • http://www.proofwiki.org/wiki/Injection_iff_Left_Inverse
  • http://www.proofwiki.org/wiki/Surjection_iff_Right_Inverse