Composite functions and one to one

I am stuck with a question,

Let $f: A\rightarrow B$ and $g:B\rightarrow C$ show that if $g\circ f$ is one to one then $f$ is one to one. Can anyone please help me out. I have no idea where to start with and how end it up.

Thanks

Suppose $x,y\in A$ such that $f(x)=f(y)$. Then $g(f(x)) = g(f(y))$. But this is the same as $(g\circ f)(x) = (g\circ f)(y)$ and $g\circ f$ being injective $\implies x=y$. This shows that $f$ is injective.
• This proves if $x=y$ then $f(x)=f(y)$, well this is true for all functions! – hhsaffar Nov 30 '13 at 6:26
• Hhsaffar is right, this answer is wrong. What you have to prove is that given $x \neq y$ you have $f(x) \neq f(y)$ for all $x,y \in A$. This is equivalent to showing that if $f(x) = f(y)$ then $x=y$, which is the contrapositive of what has just been said, and it is *not what you just did. Please reconsider what you have just wrote. – Mark Fantini Nov 30 '13 at 6:39
Suppose $f$ is not one to one, then there must be $x,y\in A,x \neq y$ such that $f(x)=f(y)$ and therefore $g(f(x))=g(f(y))$ but this means $g\circ f$ is not one to one and this is a contradiction. So $f$ must be one to one.