TITLE: How to construct a bijection $\mathbb{N} \to \mathbb{N} \times \{0, 1\}.$
QUESTION [5 upvotes]: How to construct  a bijection from $\mathbb{N}$  to $\mathbb{N} \times \{0, 1\}?$ 
My first idea was $n \mapsto (n, n \mod 2)$ but it is wrong.  Any  hint?

REPLY [2 votes]: Define $f:\mathbb{N} \times \{0, 1\}\to\mathbb{N}$ as $f(x,y)=2x+y$ and use $f^{-1}$.