*** Welcome to piglix ***

Thomae's function


Thomae's function, named after Carl Johannes Thomae, has many names: the popcorn function, the raindrop function, the countable cloud function, the modified Dirichlet function, the ruler function, the Riemann function, or the Stars over Babylon (John Horton Conway's name). This real-valued function f(x) of the real variable x is defined as:

It is a modification of the Dirichlet function, which is 1 at rational numbers and 0 elsewhere.

The popcorn function has a complicated set of discontinuities: f is continuous at all irrational numbers and discontinuous at all rational numbers.

The popcorn function also has a strict local maximum at each rational number.

Clearly, f is discontinuous at all rational numbers: since the irrationals are dense in the reals, for any rational x, no matter what ε we select, there is an irrational a even nearer to our x where f(a) = 0 (while f(x) is positive). In other words, f can never "get close" and "stay close" to any positive number because its domain is dense with zeros.

To show continuity at the irrationals, assume without loss of generality that our ε is rational (for any irrational ε′, we can choose a smaller rational ε″ and the proof is transitive). Since ε is rational, it can be expressed in lowest terms as a/b. We want to show that f(x) is continuous when x is irrational.

Note that f takes a maximum value of 1 at each whole integer, so we may limit our examination to the space between and . Since ε has a finite denominator of b, the only values for which f may return a value greater than ε are those with a reduced denominator no larger than b. There exist only a finite number of values between two integers with denominator no larger than b, so these can be exhaustively listed. Setting δ to be smaller than the nearest distance from x to one of these values guarantees every value within δ of x has f(x) < ε.


...
Wikipedia

...