Suppose \(f: A \to B\) and \(g: B \to C\) are functions. Prove or give a counterexample:
If \(f\) and \(g\) are injective (one-to-one), then \(g \circ f\) is injective.
If \(g \circ f\) is injective, then \(f\) and \(g\) are injective.
Solution
True. If \((g\circ f)(a_1)=(g\circ f)(a_2)\), injectivity of \(g\) gives \(f(a_1)=f(a_2)\), and injectivity of \(f\) then gives \(a_1=a_2\).
False as stated. Injectivity of \(g\circ f\) does force \(f\) to be injective: if \(f(a_1)=f(a_2)\), then \((g\circ f)(a_1)=(g\circ f)(a_2)\), hence \(a_1=a_2\).
But it need not force \(g\) to be injective on all of \(B\). Let \[ A=\{0\},\quad B=\{0,1\},\quad C=\{0\}, \] let \(f(0)=0\), and let \(g(0)=g(1)=0\). Then \(g\circ f\) is injective because its domain has one element, but \(g\) is not injective.