Good day everyone !
I'm just curious on how to plot (preferable in matlab or mathematica) the following stepwise function.
$ f(x) := \begin{cases} \dfrac{1}{q}~~~:~x=\dfrac{p}{q} \in \mathbb{Q} ~~\text{(in reduced form)}\\ 0~~~:~x \not \in \mathbb{Q} \end{cases} $
to illustrate that it is continuous at every irrational in the interval $(0,1)$ but discontinuous at every rational in $(0,1)$. Thanks in advance.
Plotting completely is not possible… How to represent an infinite number of discontinuity points?
Below is an approximate picture from my website.