a) If $f: A \to B$ and $g: B \to C$ and both $f$ and $g$ are injective, is $g \circ f$ also injective?
b) If $f$ is not injective, is it still possible that $g \circ f$ is injective?
c) Also, give an example where $f$ is injective, $g$ is not, but $g \circ f$ is injective.
I managed to prove part (a) by definition of injectivity with ease, but I'm having some problems with the semantics of part (b) which leads me to include part (a)'s prompt here. Specifically, it doesn't indicate whether $g$ should be injective or not, but I proved that such is not possible if $g$ is injective.
I tried to prove part (b) generally like so:
PROOF: Suppose $f: A \to B$ such that $f$ is not injective and $g:B \to C$. Then, by definition, there exist $x_1, x_2 \in A$ with $x_1 \ne x_2$ such that $f(x_1) = f(x_2)$. Thus, not for every $x_1, x_2 \in A$ with $x_1 \ne x_2$ is $f(x_1) \ne f(x_2)$. For such $x_1, x_2$ where $x_1 \ne x_2$, this would imply that $g[f(x_1)] = g[f(x_2)],$ yet $x_1 \ne x_2$ from the start. So no, it is not possible. $\square$
Is this valid reasoning that covers all possibilities for what $g$ is?
Secondly, is my example for part (c) valid?
EXAMPLE: Let $f: [0, \infty) \to \mathbb{R}$, $g: \mathbb R \to \mathbb R$ such that $f(x) = \sqrt x$ and $g(x) = x^2$. Then, $$g \circ f = g[f(x)] = g[\sqrt{x}] = \left(\sqrt x\right)^2 = x$$ Clearly, $f$ is injective on the given domain, $g$ is not injective on its domain, yet $g \circ f$ is injective from $[0, \infty)$ to $\mathbb R$. (Easy to verify, which I will not waste time writing out here).