Is the indicator function of the rationals Riemann integrable? $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.

Recall that a function is Riemann integrable if and only if, for any $\varepsilon > 0$, there exists a partition $P$ such that $U(f, P) - L(f, P) < \varepsilon$. 
Now consider any partition $P$ of $[0,1]$.  The lower sum is always zero since the infimum of the function values along any interval is zero.  Further, the supremum of the function values along any interval is $1$ as every interval contains a rational number, so we have:
$$U(f, P) - L(f, P) = U(f, P) = \sum_{k = 1}^n (x_k - x_{k-1}) = 1$$
And so the integrability criterion in the first line fails for any $\varepsilon < 1$.
