There is a problem in my calculus textbook that wants me to draw/look at the following function $f:\Bbb{R}\to\Bbb{R}$
$$f(x)=\begin{cases} 1 & : x \in \Bbb{Q} \\ 0 & : x \in \Bbb{P} \\ \end{cases}$$
The rational numbers are given by:
$\Bbb{Q}=${$\frac{a}{b} | a,b\in \Bbb{Z}, b\neq0$}
But I am choosing to only look at the positive numbers since the negative numbers will include the same patterns but mirrored on the negative x-axis.
I thought you could just list every combination of a and b as fractions to end up with all the rational numbers. So if you just look at the first 4 positive integers: $a,b\in${$0, 1, 2, 3$} you get the rational numbers: $\frac{a}{b}\in${$\frac{0}{0}, \frac{1}{1}, \frac{1}{2}, \frac{1}{3}, \frac{2}{1}, \frac{2}{3}, \frac{3}{1}, \frac{3}{2}$} after removing all combinations of a and b that leads to the same integer or by-zero-division ($\frac{1}{0}, \frac{0}{3}, \frac{2}{2}$ and so on). All other points on the x-axis would be irrational. When marking the rational numbers it would look like this:
It seemed from the drawing that over half of the rational numbers will always be in the interval [0, 1]. It seems logical from the sample above because all the fractions in the range (0, 1) make up the set: {$\frac{1}{2}, \frac{1}{3}, \frac{2}{3}$} and all the other fractions excluding the special cases $\frac{0}{0}$ and $\frac{1}{1}$ make up the set {$\frac{2}{1}, \frac{3}{1}, \frac{3}{2}$} which are just the reciprocals of other fractions. If you extend the set to: $a,b\in${$0, 1, 2, 3, 4$} you get the extra combinations: {$\frac{1}{4}, \frac{2}{4}, \frac{3}{4}$} and {$\frac{4}{1}, \frac{4}{2}, \frac{4}{3}$} where the fractions $\frac{2}{4}$ and $\frac{4}{2}$ already are points on the x-axis. This means that over half of the rational numbers are still in the interval [0, 1] when you include the fractions $\frac{0}{0}$ and $\frac{1}{1}$.
I want to prove that this pattern holds but I am not able to. One thing I am struggling with proving is that if a new combination $\frac{a}{b}$ is already accounted for, then $\frac{b}{a}$ will always also be accounted for like in the example above with $\frac{4}{2}$ and $\frac{2}{4}$.