Dirichlet Function – Is it Riemann Integrable?

calculuslebesgue-integralmeasure-theoryreal-analysisriemann-integration

"Dirichlet function" is meant to be the characteristic function of rational numbers on $[a,b]\subset\mathbb{R}$.

On one hand, a function on $[a,b]$ is Riemann integrable if and only if it is bounded and continuous almost everywhere, which the Dirichlet function satisfies.

On the other hand, the upper integral of Dirichlet function is $b-a$, while the lower integral is $0$. They don't match, so that the function is not Riemann integrable.

I feel confused about which explanation I should choose…

Best Answer

The Dirichlet function $f$ isn't continuous anywhere. For every irrational number $x$, there is a sequence of rational numbers $\{r_n\}$ that converges to it. We have: $$ \lim_{n\to\infty} f(r_n) = 1 \ne 0 = f(x) $$

Thus, $f$ isn't continuous at irrational numbers. Rational numbers can be handled similarly.