Proof
Let $\mathbb{Q} = \{\frac{a}{b}: a,b \in \mathbb{Z}, b \neq 0\}$
Define a function $f$ given by $f(a,b)=2^a3^b \in \mathbb{N}$
Then, by the fundamental theorem of arithmetic, each natural number can be rewritten as the unique product of primes. This implies that each element in the image is unique and a natural number. Thus, $\mathbb{N}$ is countable. $\square$
So here's my question. Is the proper function notation $f:\mathbb{Q} \to \mathbb{N}$ or is it $f:\mathbb{Z} \to \mathbb{N}$? Because, while each $a$ and $b$ are derived from $\frac{a}{b} \in \mathbb{Q},$ each $a$ and $b$ are integer values.
Ultimately, I'm just asking a question regarding proper notation. Pay no attention to the details of my proof. I'm just asking what the proper notation is.
If you want to prove that $\mathbb{Q}$ is countable, then you define your function as being $f:\mathbb{Q}\rightarrow \mathbb{N}$.
But actually this function can't be defined as $f:\mathbb{Z}\rightarrow \mathbb{N}$ even if you consider $f(a,b)$ since it is then defined on $\mathbb{N}^2$...
But if you want to prove that $\mathbb{Q}$ is countable, I suggest you rather show that there exists a bijection between $\mathbb{Q}$ and $\mathbb{Z}\times \mathbb{N}^*$, which is countable since it is the product of two countable spaces.