Give an example of two functions $f$ and $g$ for which $f$ is injective, but $g\circ f$ is not.
I suspect this will do:
$$f(x) = x~\text{and}~g(x)=1$$
This is the image which leads me to this conclusion:
\begin{eqnarray} & \vdots & \\ 1 & \longrightarrow & 1 \\ &&&\searrow \\ &&&~~~~1\\ &&& \nearrow\\ 2&\longrightarrow&2 \\ &\vdots&& \end{eqnarray}
Your example is right. $f(x)=x$ is injective , can you see why?
Now $g(f(x))=1$ for every $x$. Can a constant function be injective?
Remember the definition of injective function: a funtion $f$ defined on $A$ is injetive iff $\forall a,b \in A, \;\; f(a)=f(b) \Rightarrow a=b$