Counterexample to $g \circ f$ one-to-one $\implies$ $g$, $f$ one-to-one 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.
 A: 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.
A: Let $X$ be a singleton. 
Then automatically $g\circ f:X\to Z$ and $f:X\to Y$ are one-to-one. 
But there are no restrictions for function $g:Y\to Z$ except that its domain $Y$ is not empty.
E.g. you can let $Y$ have at least two elements and take $g$ constant.
A: Below a visual counterexample showing that the injectivity ( " one-to-oneness") of the composite function:  f o g  does not imply the injectivity of both f ang g. 
It also shows that the bijectivity of f o g does not even imply  f or g to be bijective. 
In this counterexample, the composite function f o g is the identity function, but this need absolutely not be the case.   In the setZ below ( see diagram) , substitute a for c, c for b and b for a, and you obtain a new f o g  function that is not the identity function, but that is still one-to-one. 
Note : making these substitutions in Z does not turn Z into a different set; for in a set as such there is no order, the "place" of elements does not count  : {a, b c} = {c,a,b} = Z 

