Composition of injections (proof)

It's good, but proving injectivity is often easier with the contrapositive:

if $f(x_1)=f(x_2)$, then $x_1=x_2$.

So, assume $f$ and $g$ are injective and suppose $$ g\circ f(x_1)=g\circ f(x_2). $$ This means $$ g(f(x_1))=g(f(x_2)) $$ that, by the injectivity of $g$, implies $$ f(x_1)=f(x_2). $$ Injectivity of $f$ allows us to argue that $$ x_1=x_2. $$

As you clearly see, these are the same steps as in your proof; but dealing with equality is psychologically easier than dealing with inequalities.


Looks great. Adding in the $y_1$ and $y_2$ is extraneous, and some people would leave that out of the proof.