Originally Posted by

**Swlabr** We can also use $\displaystyle cos(x): \mathbb{R} \rightarrow [-1, 1]$. Note that this is a surjection.

Noting that $\displaystyle cos(x) = cos(x+2\pi)$, if $\displaystyle x \in \mathbb{Q}$ then $\displaystyle x+2\pi \not\in \mathbb{Q}$. Thus, letting $\displaystyle f$ be the restriction of $\displaystyle cos(x)$ to $\displaystyle \mathbb{R}\setminus \mathbb{Q}$ we see that $\displaystyle f: \mathbb{R}\setminus \mathbb{Q} \rightarrow [-1, 1]$ is a surjection onto something with cardinality that of $\displaystyle \mathbb{R}$. This is sufficient.

(This is sufficient because if there exists a surjection from $\displaystyle A$ to $\displaystyle B$ then $\displaystyle |A| \geq |B|$. Similarly, if there exists an injection from $\displaystyle A$ to $\displaystyle B$ then $\displaystyle |A| \leq |B|$. Clearly the latter holds, and the former holds by what I just wrote about. Thus, $\displaystyle |\mathbb{R} \setminus \mathbb{Q}| = |\mathbb{R}|$, as required.)