Real Analysis – Integral of Thomae’s Function

integrationreal-analysis

Define the following function $f : \mathbb{R} \to \mathbb{R}$ as follows:

$f(x) = 0$ if $x$ is irrational

$f(x) = 1/n$ if $x$ is rational and $x = \frac{m}{n}$ in lowest terms.

Some googling comes up that this is known as "Thomae's function." I need to prove the integrability of this function AND find its integral over $[0,1]$.

The integrability is shown by proving that the function is continuous at irrationals and discontinuous at rationals and then using the Lebesgue criterion for integrability. However, I'm having trouble finding the value of the integral.

I'm not sure if it is zero or not, which is making it hard for me to come up with a proof method. While the similarly defined Dirichlet function has a integral of 1, the reason I suspect this function might be zero is that the value of many points are, in this case, negligible due to large denominators.

Best Answer

In fact, the function is even Riemann integrable. This is actually easy to see: Since there are only finitely many points where the function is larger than $1/n$, it is possible to choose a step function $g$ such that $0 \leq f \leq g$ and $\int_0^1 g(x) dx \leq 2/n$.

Note also that a bounded function if Riemann integrable if the set of points where it is not continuous has Lebesgue measure zero.

Related Question