Let $f:X\longrightarrow Y$ and $g: Y\longrightarrow Z$. Show that, if $g\circ f$ is $1$-$1$, then $f$ is $1$-$1$, but $g$ is not necessarily $1$-$1$
I don't know how to start the proof. We have that $(g\circ f)(x_1)=(g\circ f)(x_2)\Longrightarrow x_1=x_2.$ And I want to show that:
$$[(g\circ f)(x_1)=(g\circ f)(x_2)\longrightarrow x_1=x_2]\longrightarrow [f(x_1)=f(x_2)\longrightarrow x_1=x_2].$$
Can one say that $(g\circ f)(x_1)=(g\circ f)(x_2)$ because $f(x_1)=f(x_2)\,\forall x_1,x_2\in X:x_1=x_2$ or because $g$ is given by $y\mapsto c, c$ a constant?
I'm really having trouble to organize my ideas, if someone could give me a hint it would be very much appreciated.
$f(x_1) = f(x_2) \Rightarrow g(f(x_1)) = g(f(x_2)) \Rightarrow x_1 = x_2.$
Can you guess an example where $g$ is not one-one?