Can you give me an example of two functions $f:\mathbb{R}\rightarrow \mathbb{R}$ and $g:\mathbb{R}\rightarrow \mathbb{R}$ such that $$f\text{ is injective}\quad\text{and}\quad g\mbox{ is surjective}$$ but the composite $g\circ f$ is neither injective or surjective?.
In addition, if we have to injections $f:A\rightarrow B$, $g:B\rightarrow A$ how can I define a bijection between $A$ and $B$, I think that $h(x)=f(x)$ works for injection but I don't know how to write clear the surjectivity, I belive that given $b\in B$, it's enough to choose $a=g(b)$ but I don't know how to prove it correctly.
Hint. An example of function $g:\mathbb{R}\rightarrow \mathbb{R}$ such that $g$ is surjective (but not injective) is $$g(x)=x(x-1)(x+1)=x^3-x.$$
Are you able to find an injective function $f$ (not surjective) such that the $g\circ f$ is neither injective or surjective?