Let,

f:Y--> Z be one-to-one

g:X--> Y be a function

f o g: X-->Z be one-to-one

Let,

h = f o g

Then,

we need to show that if g(x1)=g(x2) then x1=x2

We know that if,

h(x1)=h(x2) then x1=x2 thus,

f(g(x1))=f(g(x2))

then,

g(x1)=g(x2)

I cannot see how you can conclude that g is one-to-one from these statements.

I did not think of a counterexample but I would guess no.