Suppose that $f:X\to Y$ and $g:Y\to Z$ are functions. If both $f$ and $g$ are one-to-one, then $g\circ f:X\to Z$ is one-to-one.
I believe the converse would be written: Suppose that $f:X\to Y$ and $g:Y\to Z$ are functions. If $g \circ f: X \to Z$ is one-to-one, then both $f$ and $g$ are one-to-one.
I cannot come up with a counterexample and I believe the converse is also true. Any thoughts.

Take $g:\mathbb R\to \mathbb R$ defined by $g(x)=x^2$ and $f:\mathbb R^+\to \mathbb R$ defined by$f(x)=\sqrt x$. Then $g\circ f: \mathbb R^+\to \mathbb R$ is given by $(g\circ f)(x)=x$, that is injective, but $g$ is not injective.