Answer
**No**, \(g\) need not be injective even if \(g\circ f\) is injective.
Work Step by Step
## Counterexample
Let us define sets and functions as follows:
- **Sets**:
- \(X = \{\,1,\,2\}\),
- \(Y = \{\,u,\,v,\,w\}\),
- \(Z = \{\,p,\,q\}\).
- **Function** \(f: X \to Y\):
\[
f(1)=u,\quad f(2)=v.
\]
(So the image of \(f\) is just \(\{u,v\}\subset Y\).)
- **Function** \(g: Y \to Z\):
\[
g(u)=p,\quad g(v)=q,\quad g(w)=q.
\]
Notice \(g\) is **not** injective, because \(g(v)=g(w)=q\) despite \(v\neq w\).
### Check \(g \circ f\) for Injectivity
1. \((g \circ f)(1) = g\bigl(f(1)\bigr) = g(u) = p.\)
2. \((g \circ f)(2) = g\bigl(f(2)\bigr) = g(v) = q.\)
These two outputs are different (\(p \neq q\)). Hence \((g \circ f)(1)\neq (g \circ f)(2)\), so \(g \circ f\) is injective as a map \(X \to Z\).
### Yet \(g\) is Not Injective
Within \(Y\), we have \(v \neq w\) but \(g(v)=g(w)=q\). So \(g\) itself fails injectivity.
---
## Conclusion
This example demonstrates that \((g \circ f)\) can be injective **even if** \(g\) is not. Intuitively, the non‐injective “collision” in \(g\) (namely \(v\) and \(w\)) does not matter because \(f\) never maps any element of \(X\) to \(w\). Hence those identified points in \(Y\) are never “used” by the composition, allowing \((g \circ f)\) to remain injective.