I am trying to prove that $\mathbb{Q}^2 = \{(x,y) \in \mathbb{R}^2 : x,y \in \mathbb{Q}\}$ is countable, where countable means that the set is either finite or has the same cardinality as $\mathbb{N}$. Here is a sketch of my attempt.
We can first prove that $\mathbb{Q}$ is countable. (I know how to do this using a diagonal argument.) So there exists a bijection $f: \mathbb{N} \to \mathbb{Q}$. I can then prove that $\mathbb{N} \times \mathbb{N}$ is countable using a diagonal argument. Therefore, there exists a bijection $g: \mathbb{N} \to \mathbb{N} \times \mathbb{N}$. Bijective implies invertible, so there must also exist an inverse $h: \mathbb{N} \times \mathbb{N} \to \mathbb{N}$. I can now compose bijections to get $f \circ h: \mathbb{N} \times \mathbb{N} \times \mathbb{N}$, but the composition of bijections is a bijection. Since bijection implies invertible, there exists an inverse $a: \mathbb{N} \to \mathbb{N} \times \mathbb{N}$, so $\mathbb{N} \times \mathbb{N}$ is countable.
I should be able to then form a bijection between $\mathbb{N} \times \mathbb{N}$ and $\mathbb{Q} \times \mathbb{Q}$ by composing bijections. I cannot figure out exactly how to do this, but the argument is surely similar to the above. By composing bijections again, I get a bijection between $\mathbb{N}$ and $\mathbb{Q} \times \mathbb{Q}$.
Is this correct? Is there an easier way to do it? I would like to avoid using a diagonal argument and instead write an explicit mathematical formula.