Solution (source code)

= Solution

The integers are countable under the enumeration
$$
0,1,-1,2,-2,\ldots.
$$
Part (i) then shows that $\mathbb Z\times\mathbb N$ is countable. The map
$$
(a,b)\longmapsto\frac ab
$$
is a surjection from $\mathbb Z\times\mathbb N$ onto the <rational numbers>. Selecting, for example, the representation in lowest terms with positive denominator gives an injection in the other direction. Thus $\mathbb Q$ is countable.