Algebraically I do understand the usual proof of the proposition, like the on in the accepted answer: If $g \circ f$ is injective, so is $g$
But I still am missing something. When I draw the composition of $g$ and $f$, I can draw $g \circ f$ as injective while $f$ is merely surjective. What am I doing wrong here? According to the proposition this should not be possible.
In the figure, $f$ is blue $g$ is red and thus $g \circ f$ is violet. Notice how $g \circ f$ is injective (while $g$ alone is not), but $f$ is not injective.