![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlMihVE3xMAtfejKVBL4af9QJB9sJdre4-hCtNbTr1xNEUaz8vsdHMJ3wJ4wPk2ebCZIcB3BeoaJXYSKpQ-nRhQIBuNigYusPEn2ZcTgkr1nPS4dsn2okisjTZB5Nw-VJ0pT-9/s600/thomae-def.png)
Here is the graph of this function with some points highlighted as plus symbols for better view.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0xvaEy_5aH2ymntCGx1Q7P69iWttk15N_fnqZQEdbHj6V2sVx-aR0mp_wnxXh7ijJhMLCy01zQvYU4VDf0ZmFOd7YRsutj_rzffc7o6n5zrtyVrk0W9bH4DPzZaUljnFqIPX9/s1200/thomae.jpg)
This function has interesting property: it's continuous at all irrational numbers. It's easy to see this if you notice that for any positive ε there is finite number of points above the line y = ε. That means for any irrational number x0 you can always construct a δ-neighbourhood that doesn't contain any point from the area above the line y = ε.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiH19ebr_zDCa31K_grwFpI6AGnEMWZunWvznY64ZQODBlH-TVuOhWtlOOpYY28VEO21rZ9JL3XWIXRuJcQ-sa-YGPnU2tnUFlhn5IEiA5jzoV4Jkdmrz5L-wSHWNoFYo-2RR-E/s1200/thomae-e-d.jpg)
To generate the data file with point coordinates I used Common Lisp program:
(defun rational-numbers (max-denominator)
(let ((result (list)))
(loop for q from 2 to max-denominator do
(loop for p from 1 to (1- q) do
(pushnew (/ p q) result)))
result))
(defun thomae-rational-points (abscissae)
(mapcar (lambda (x) (list x (/ 1 (denominator x)))) abscissae))
(defun thomae (max-denominator)
(let ((points (thomae-rational-points (rational-numbers max-denominator))))
(with-open-file (stream "thomae.dat" :direction :output)
(loop for point in points do
(format stream "~4$ ~4$~%" (first point) (second point))))))
(thomae 500)
To create the images I used gnuplot commands:
plot "thomae.dat" using 1:2 with dots
plot "thomae.dat" using 1:2 with points
and Photoshop.