One of f and g has to be injective for g ◦ f to be injective. Is this a counter-example 
In this example that I have created, f and g are both surjective and total (total is a requirement for both f and g in this question) and the composite is bijective meaning it is injective. Is this a counter-example?
Context: Im studying cs first year in uk and one of the modules is discrete maths

Suppose $f$ is not injective.  Then there exist some $x_1$ and $x_2$ with $x_1\neq x_2$ such that $f(x_1)=f(x_2)$.
It follows then that $g(f(x_1))=g(f(x_2))$ and so by definition $(g\circ f)(x_1)=(g\circ f)(x_2)$ and therefore $(g\circ f)$ is also not injective.
That is to say, if $g\circ f$ is injective then $f$ must also be injective.
