It's classical (by a back-and-forth argument; see for instance A Shorter Model Theory by Hodges) that any two countable dense unbounded linear orders without endpoints are isomorphic, so that for example the linear order $\mathbb{Q}$ is isomorphic to $\mathbb{Q}(\sqrt{2})$ ordered as usual. So they are homeomorphic under their order topologies. Then $\mathbb{Q} \times \mathbb{Q} \to \mathbb{Q}(\sqrt{2})$, sending $(r, s)$ to $r + s\sqrt{2}$ is a homeomorphism. Compose these two homeomorphisms to establish a homeomorphism $\mathbb{Q} \times \mathbb{Q} \cong \mathbb{Q}$. There are other methods, based on for example putting pairs of finite continued fractions together to form a continued fraction of greater size, that could be used (after some slight finagling).