# Set theory and maps [duplicate]

Prove or disprove: For any sets X,Y,Z and any maps f:X→Y and g:Y→Z, if f is injective and g is surjective, then g ◦ f is surjective.

sorry im back to sets again. but then i realised all my workings are wrong after i gone through with my tutor on this question. i think a more strong proof would be stating an example to help me better on this. an example where f is injective and g is surjective, but gof is neither surjective nor injective, thus proving the statement is false. thanks a lot and sorry for the trouble... :(

• I allready gave you an example here and here. Why don't you accept these? Sep 7, 2015 at 14:19
• @drhab: If this is a duplicate, why aren't you voting to close as a duplicate? Sep 7, 2015 at 14:24
• @AsafKaragila Yes, I have done by now. First I hoped to hear a reaction of the OP. Sep 7, 2015 at 14:28

This is false. Why? g being surjective means that to every element $z \in Z$, we can find an element in $Y$ which maps to $z$ under $g$. The obvious question to ask then is what happens if $f(X)$ isn't all of $Y$. Then it's at least possible to leave out necessary elements.
For an example, take $X = Y = Z = \mathbb{Z}$ the integers. Let $g$ be the identity map ($g(z) = z$ for all $z \in \mathbb{Z}$) and let $f(x) = 2x$ be the doubling map. Then $g \circ f = f$.
Let $f: \Bbb R \to \Bbb R^2$ be given by $f(x) = (x,0)$ and let $g: \Bbb R^2 \to \Bbb R$ be given by $g(x,y) = y$. Then $f$ is injective and $g$ is surjective, but the composition $(g\circ f)(x) = g(x,0) = 0$ is neither injective nor surjective.