[Math] Find a bijection function from $\mathbb{R}\to\mathbb{R}\backslash\mathbb{Z}$

elementary-set-theory

I need to find bijection
$$
f:\mathbb{R}\to\mathbb{R}\backslash\mathbb{Z}
$$
Such a function exists, because the two sets have the same cardinality, but I can't find an explicit one, any ideas?

Best Answer

Hint: Fix $a_n$ as a sequence of irrational numbers, and write $\mathbb Z=\{z_n\mid n\in\mathbb N\}$. Define a function which sends $a_n$ to $a_{2n}$; $z_n$ to $a_{2n+1}$; and $x$ to itself otherwise.