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.

In your picture, $f$ is not surjective.
The beginning of the red arrow has no preimage, hence $f$ is not surjective but your result require $f$ to be a surjective function.
Edit: Also, as mentioned in the comment, $g\circ f$ is not injective as well.
btw, to make sure your function has a chance to be injective, make sure your codomain is at least as large as your domain. Notice that domain of $g\circ f$ is equal to the domain of $f$.
Strictly speaking, the second part is just the function $g$ and the whole picture is $g \circ f$.