I cannot find an inverse of this function for $f(n) = x$, where $x$ is an integer, that gives out a natural number. Some guidance would be very helpful... I already know the function is bijective so there has to be an inverse.
Edited to add that I tried letting $n = 2x$ but since $x$ is an integer, there's still the possibility of having an input like $-2$ that gives a negative number, which is clearly not a natural number.
The function does this:
$$1\to 0$$ $$2\to 1$$ $$3\to -1$$ $$4\to 2$$ $$5\to -2$$ $$\vdots$$ and so on.
The inverse would be $g\colon\mathbb{Z}\to\mathbb{N}$ defined by $$g(n) = |2n|+\boldsymbol{1}_{\{n\leq 0\}},$$ where $\boldsymbol{1}_{\{n\leq 0\}}$ is the characteristic function on the event $\{n\leq 0\}$, i.e. it is $1$, when $n$ is non-positive, and is otherwise $0$.
You need to check that this is indeed the inverse.