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 $X$ is any set at all with $\left| X \right| > 1$ then the diagonal map
$$\begin{align}\Delta : X &\to X \times X \\ x &\mapsto (x,x)\end{align}$$
and the projection map
$$\begin{align}\pi : X \times X &\to X\\ (x,y) &\mapsto x \end{align}$$
satisfy $\pi \circ \Delta = \text{id}_X$, which is bijective, and yet neither $\Delta$ nor $\pi$ is bijective.

In a similar vein, if $f : X \to Y$ is any function and $\left|Y\right| > 1$ then we can take the graph $\Gamma_f : X \to X \times Y$ given by $\Gamma_f(x) = (x,f(x))$ and the same projection. The above example is the special case where $f(x)=x$.
