TITLE: Are the rationals homeomorphic to any power of the rationals?
QUESTION [52 upvotes]: I asked myself, which spaces have the property that $X^2$ is homeomorphic to $X$. I started to look at some examples like $\mathbb{N}^2 \cong \mathbb{N}$, $\mathbb{R}^2\ncong \mathbb{R}, C^2\cong C$ (for the cantor set $C$). And then I got stuck, when I considered the rationals. So the question is:
Is $\mathbb{Q}^2$ homeomorphic to $\mathbb{Q}$ ?

REPLY [19 votes]: As Gerald Edgar points out in his comment on Xandi Tuni's answer, the continued fraction trick works for the irrationals, not for the rationals.  But this turns out to be enough:
1) An irrational number has a unique continued fraction expansion.  Therefore the irrationals are isomorphic to an infinite direct product of ${\mathbb Z}$ with itself.  Therefore (writing ${\mathbb I}$ for the irrationals) we have ${\mathbb I}={\mathbb I}^2$.  
2)  Therefore ${\mathbb I}^2$ imbeds as a dense subset of the reals.  Now map ${\mathbb Q}\times {\mathbb Q}$ to ${\mathbb I}\times {\mathbb I}$ by (say) adding $\sqrt{2}$ to each component.  This imbeds ${\mathbb Q}\times {\mathbb Q}$ as a countable dense subset of the reals.  
3)  Now use the fact that every countable dense subset of the reals is homeomorphic to ${\mathbb Q}$.