Find an example of functions $f, g: \mathbb{N} \rightarrow \mathbb{N}$ whose composition $f \circ g=id_{\mathbb{N}}$ and at the same time $g \circ f \neq id_{\mathbb{N}}$.
First thing we can see is that $f$ is injective and $g$ is surjective, but I can't seem to figure out what to do next.
Yes, first just to make sure we are using same notations, I assume that $0\in\mathbb{N}$.
Let $f:\mathbb{N}\rightarrow\mathbb{N}$ be $f(x)=x+1$
and $g:\mathbb{N}\rightarrow\mathbb{N}$ be $g(x)=x-1$ whenever $x\not = 0$ and $g(x)=0$ if $x=0$.
Now, $g\circ f (x) = g(x+1)=x+1-1=x$ hence $g\circ f = Id$. While $f\circ g(0)=f(0)=1$ hence $f\circ g$ is not the identity.