Creating a composite function that is injective with an injective and a non-injective part Find an example of functions $f:A\to B$ and $g:B\to C$ such that $f$
and $g\circ f$ are both injective, but $g$ is not injective.
So If I understand this correctly,


*

*Need a function $f$ that is injective and that will also make $g$ injective when plugged in during $g\circ f$.

*Need a function $g$ that is not injective on its own

*The range of $f$ must be a subset of the domain of $g$


I tried thinking along the lines of using variations of $f(x)=x$ and $g(x)=x^2$ but all those leave my composite function as non injective
I've also been using $x\in\Bbb R$ so as to keep the range of $f$ and domain of $g$ the same. 
Any suggestions of where to go with this? Thank you
Edit:
Thank you everyone the answers were very helpful in understanding the problem and concepts better
 A: Hint.  Let's take $g:{\Bbb R}\to{\Bbb R}$ with $g(x)=x^2$ as you suggested - a good, simple, well-known function which is not one-to-one.  Suppose we want $f:{\Bbb R}\to{\Bbb R}$ also.
To say $g\circ f$ is one-to-one means: if you know the value of $g(f(x))$ then you know the value of $x$ - that is, know it for sure, with only one possibility.  So, suppose the value of $g(f(x))$ is given.  We have
$$g(f(x))=(f(x))^2\ ;$$
a good way to proceed from here would be [1] find the value of $f(x)$, then [2] find the value of $x$.  Step [2] is easy as $f$ is supposed to be one-to-one.  The problem is that step [1] would usually give you two values of $f(x)$.
But now suppose, for example, that $f(x)$ is always positive.  Then step [1] gives a definite value of $f(x)$ and all is OK.
So - can you think of a (well known) one-to-one function $f:{\Bbb R}\to{\Bbb R}$ for which $f(x)$ is always a positive number?
Hope this doesn't sound too long-winded but I am hoping to illustrate how you can think about this kind of problem.
A: Take $f:[0,\infty)\to\Bbb R$ with $f(x)=x$ and $g:\Bbb R\to[0,\infty)$ with $g(x)=|x|$. Then $f$ is injective and $g$ is not, while $g\circ f:[0,\infty)\to[0,\infty)$ is the identity function and is therefore injective.
A: $g:B\to C$ being non-injective means that there are distinct $b,b'\in B$ with $g(b)=g(b')$. All you need is to ensure that the image of $f$ never contains both values $b$ and $b'$ at the same time (maybe neither).
Example.
Choose $g(x)=x^2$, then the injectivity violating pairs are $(x,-x)$ for $x>0$. Just make sure that if $f(x)=y$, then there is no $x'$ with $f(x')=-y$, e.g. choose
$$f(x)=e^x$$
which is injective and will only assume positive values. Note that here $A=C=\Bbb R$ and $B=(0,\infty)$.
