Describing a bijection between $\{0,1\} \times \mathbb N$ and $\mathbb Z$. I'm having a bit of trouble formulating a bijection between the sets $\{0,1\} \times \mathbb N$ and $\mathbb Z$. I understand how to find a bijection between $\mathbb N$ and $\mathbb Z$ using a piecewise function that sends even values of $\mathbb N$ to positive integers and odd values of $\mathbb N$ to negative integers, but I'm a bit stuck formulating a function $f(a,n)$ for these two sets. Any help would be greatly appreciated and I apologize for formatting.
 A: Assuming $\Bbb N$ does not contain zero, you can use
$$f(s,n)\quad=\quad\begin{cases} n&\text{for $s=0$} \\ 1-n &\text{for $s=1$}\end{cases} \quad=\quad (-1)^s\left(n-\frac12\right)+\frac12$$
which can be written with or without cases.
A: Visual solution:
$\mathbb N$ looks like this:
$$\times\times\times\times\times\times\times\times\times\times\cdots\\$$
So $\mathbb N\times\{0,1\}$ looks like this:
$$\times\times\times\times\times\times\times\times\times\times\cdots\\
\times\times\times\times\times\times\times\times\times\times\cdots\\$$
While $\mathbb Z$ looks like this:
$$\cdots\times\times\times\times\times\times\times\times\times\times\cdots\\$$

Now, imagine you take the middle picture and you take the upper line of $\times$-s and flip it so you would get:
$$\cdots \times\times\times\times\times\times\times\times\times\times\times\\
\times\times\times\times\times\times\times\times\times\times\cdots\\$$
Now, imagine if I draw a little more space between two arbitrary elements of $\mathbb Z$:
$$\cdots \times\times\times\times\times\times\qquad\times\times\times\times\times\times\cdots\\$$
Can you see the bijection that is naturally appearing between these two sets?
