Bijective function from $\Bbb Z^+$ to $\Bbb Z\backslash \{-1,0,1\}$

Based on what someone in the comments section said about the output forming a sequence like $2, -2, 3, -3, 4, -4, ...$, I came up with the following function:

$f(n)=\left\lceil{\left(\frac{n+2}{2}\right)}\right\rceil\cos\left(\pi n\right)$

Graphically, it would look like this:

Desmos graph


Claim: if $\alpha: A\to B$ is a bijection and $\beta:B\to C$ is a bijection, $\gamma:A\to C$ given by $\gamma:=\beta\circ \alpha$ is a bijection. This allows us to make 'pit stops', i.e. to construct the bijection one map at a time.

To go from $\mathbb{Z}^+\to \mathbb{Z}$, one way is send $n$ to $(n+1)/2$ if $n$ is odd (this will map into $\mathbb{Z}^+$) and to send $n$ to $(2-n)/2$ if $n$ is even (this will map into $\mathbb{Z}^-\cup \{0\}$).

Now that we're in $\mathbb{Z}$, we can 'delete zero' from the range by sending $n$ to $n+1$ if $n\ge 0$ and otherwise sending $n$ to itself (i.e., leaving it untouched).

I will leave it to you to extend this to deleting the other two points and to come up with a closed-form, if you wish.