Prove $f$ and $g$ are not bijections if $f \circ g$ is a bijection. I know that if $A$ is an finite set, and $f : A → A$, and $g : A → A$, then if in addition  $f ◦ g : A → A$ is a bijection, then both $f$ and $g$ are also bijections. 

However, is there an example to prove that if $A$ is an infinite set then both $f$ and $g$ are not bijections if $f \circ g : A \rightarrow A$ in addition is a bijection.
Let $f,g \colon \mathbf N \to \mathbf N$ be given by 
$$ g(n) = n+1, $$
and
$$ f(n) = \begin{cases} n - 1 &amp; n \ge 1\\
                         27   &amp; n = 0 .\end{cases}
$$
then neither $f$ nor $g$ is bijective, but $f \circ g = \mathrm{id}_{\mathbf N}$ is.
Another example is $f, g: \mathbb{R} \to \mathbb{R}$ where $g(x) = e^x$ and $f(x) = \ln |x|$ (with $f(0) = 0$).

However, what is true is,


  Proposition. If $f \circ g$ is a bijection then $f$ is surjective and $g$ is injective.


and,


  Corollary. If $f \circ g$ and $g \circ f$ are bijections, then $f$ and $g$ are bijections.