I am not a student of core mathematics and hence as a result, all of my educational (engg.physics) background is based on the notion of applied mathematics rather than core mathematics, but I am attending a lecture in probability theory where the professor proved that the set of rational numbers is bijective to the set of natural numbers and hence the set of rational numbers $\mathbb{Q}$ is countable.
I am trying to prove it in a different way and would like the "core" mathematicians to check if I am making any logical fallacy in my arguments. Here it goes
Let me define $\mathbb{N}^2$ as $$\mathbb{N}^2=\left\{(x,y)|x,y\in\mathbb{N}\right\}$$ Hence, I claim that $\mathbb{N}^2$ is countable, since $f:\mathbb{N}\to\mathbb{N}^2$ is clearly bijective. Now, I define $$\mathbb{Q}=\left\{\frac{p}{q}|(p,q)\in\mathbb{N}^2\right\}$$ Since, $f:\mathbb{N}^2 \to \mathbb{Q}$ is clearly surjective and $\mathbb{N}^2$ is countable, that implies that $\mathbb{Q}$ is countable
Is this proof of mine logically correct? If not, please let me know if I have assumed something somewhere where I should not have assumed stuff. Your help is really appreciated.