Example where $f\circ g$ is bijective, but neither $f$ nor $g$ is bijective Can anyone come up with an explicit example of two functions $f$ and $g$ such that: $f\circ g$ is bijective, but neither $f$ nor $g$ is bijective?
I tried the following: $$f:\mathbb{R}\rightarrow \mathbb{R^{+}}
$$ $$f(x)=x^{2}$$
and  $$g:\mathbb{R^{+}}\rightarrow \mathbb{R}$$
$$g(x)=\sqrt{x}$$
$f$ is not injective, and $g$ is not surjective, but $f\circ g$ is bijective
Any other examples?

If we define $f:\mathbb{R}^2 \to \mathbb{R}$ by $f(x,y) = x$ and $g:\mathbb{R} \to \mathbb{R}^2$ by $g(x) = (x,0)$ then $f \circ g : \mathbb{R} \to \mathbb{R}$ is bijective (it is the identity) but $f$ is not injective and $g$ is not surjective.
