[Math] Is the indicator function of the rationals Riemann integrable

analysisdefinite integralsintegrationreal-analysisriemann sum

$f(x) =
\begin{cases}
1 & x\in\Bbb Q \\[2ex]
0 & x\notin\Bbb Q
\end{cases}$

Is this function Riemann integrable on $[0,1]$?

Since rational and irrational numbers are dense on $[0,1]$, no matter what partition I choose, there will always be rational and irrational numbers in every small interval. So the upper sum and lower of will always differ by $1$.

However, I know rational numbers in $[0,1]$ are countable, so I can index them from 1 to infinity. For each rational number $q$ in $[0,1]$, I can cover it by $[q-\frac\epsilon{2^i},q+\frac\epsilon{2^i}]$. So all rational numbers in $[0,1]$ can be covered by a set of measure $\epsilon$. On this set, the upper sum is $1\times\epsilon=\epsilon$. Out of this set, the upper sum is 0. So the upper sum and lower sum differ by any arbitrary $\epsilon$. Thus, the function is integrable.

One of the above arguments must be wrong. Please let me know which one is wrong and why. Any help is appreciated.

Best Answer

The answer depends in which sense you want to integrate the function.

The function is not Riemann integrable. The problem is that you consider finite partitions there to form the Riemann sums; so, roughly speaking, you cannot make a choice for each rational as you consider finite partitions. (Your first argument is correct.)

The function is however Lebesgue integrable. There the argument using measure is relevant.

The function is also integrable in the Henstock-Kurzweil sense. Very roughly, this is similar as Riemann but in fact allows to make "more choices."

Related Question