Let $f:X\rightarrow Y, g:Y\rightarrow Z$. Show that if $f$ and $g$ are injective, then $g \circ f$ is also injective.
My attempt:
- $x \neq x’ \implies f(x) \neq f(x’)$
- $f(x) \neq f(x’) \implies g(f(x)) \neq g(f(x’))$
$(A\implies B) \wedge (B\implies C) \implies (A\implies C)$
Therefore: $x\neq x’ \implies g(f(x))\neq g(f(x’))$
Hence $g \circ f$ is injective.
Perfectly correct. You can also proceed as follows:
Let $x,x' \in X$. Then $$(g \circ f)(x) = (g\circ f)(x')\implies g(f(x)) = g(f'(x)) \implies f(x) = f'(x) \implies x = x'$$
where the second implication uses that $g$ is injective and the third (and last implication) that $f$ is injective.
A good follow up exercise: show that the same holds if you replace 'injective' by 'surjective'.