TITLE: Surjection on composed function?
QUESTION [5 upvotes]: Helping a buddy with his "intro to math" course for CompSci. I'm afraid my 'leet math skills are already giving out, so any help would be appreciated!
If f and g are both surjective functions, then so is the composition f o g. (so far so good).
I would expect the converse to be true too: If f o g is a surjective function, does that mean f and g are surjective?
From my research so far it seems that in this case f is indeed surjective but g is not necessarily so. Can anybody explain why, please? An example would rock!

REPLY [2 votes]: For a treatment of these basic facts about what happens to injectivity and surjectivity under composition, see Section 2.5 of these lecture notes from a "transition to upper level mathematics" course that I taught twice at UGA.  Note that elsewhere in the course there were exercises asking students to prove that certain other statements which are not listed here are not always true: e.g. if $g \circ f$ is surjective, then $g$ must be surjective (as is in the notes) but $f$ need not be.  Similarly, if $g \circ f$ is injective, then $f$ must be injective (...) but $g$ need not be.
Given how fundamental and ubiquitous these results are, it's surprising that they are not always covered in standard texts.  (I guess the student is supposed to figure them out for herself, but in my experience most actual undergraduates do much better if they are exposed to these concepts in the context of an actual formal course.)