Proof of the denumerability of $\mathbb{Z}$ I know I could just look this up, but I thought I'd just ask because I like this site and I get feedback.
To prove a set is denumerable we have to show there exists a bijection from the set in question.  So to show that $\mathbb{Z}$ is denumerable, we just need a bijection $f:\mathbb{N}\rightarrow\mathbb{Z}$.
I thought of such a bijection, namely, $f(n)=(-1)^{n}\left\lfloor \frac{n}{2}\right\rfloor$.
This seems to do the trick but I'm feeling like there are simpler mappings that I'm not seeing.
 A: How about the piecewise defined function which assigns $0$ to $0$, each positive even number $2n$ to $n$ and each positive odd $2n-1$ to $-n$?
A: First, let's recall that $\mathbb{Z}$ can be defined in the following terms (it's not the only way to construct the set of the integers, but this construction is good enough for our purposes)
Let
$$\mathcal{Z}=2\times\mathbb{N}$$
And let
$$\mathbb{Z}=\mathcal{Z}/\sim$$
Where $\sim$ is the relation that identifies $\langle 0,0\rangle$ with $\langle 1,0\rangle$ (leaving the remaining elements of $\mathcal{Z}$ untouched), and call this element the zero element of$\;\mathbb{Z}$; let's denote it by $0_\mathbb{Z}$. On the other hand, every element with first coordinate equal to $0$ other tan $0_\mathbb{Z}$ will be called a negative integer number, while every element with first coordinate equal to $1$ other tan $0_\mathbb{Z}$ will be called a positive integer number.
After this digression into the formal construction of $\mathbb{Z}$, we can define the desired surjection.
Let $f:\mathbb{N}\longrightarrow\mathbb{Z}$ be defined by: for every $n\in\mathbb{N}$, let
$$f(n)=\begin{cases}
  0_\mathbb{Z}\qquad\,\text{if }n=0\\
  \langle 0,k\rangle\quad\text{if }n=2k\;\text{for some }k\in\mathbb{N}\\
  \langle 1,k\rangle\quad\text{if }n=2k+1\;\text{for some }k\in\mathbb{N}
\end{cases}$$
It also follows that $f$ is not only surjective, but also injective.
In my opinion, this function is easier to understand and to handle than the one you gave, for reasons of simplicity: you are using powers, rational numbers and the floor function, which are complex objects (from a set-theoretical point of view) to fully describe your function, whereas the function I gave above is elementary and doesn't require anything but the existence of $\mathbb{N}$ and cartesian products.
