# Why this function is not Riemann integrable on $[0, 1]$

Why this function is not Riemann integrable on [0, 1] ? $$f\left(x\right)=\begin{cases} x & x\in\mathbb{Q}\\ 0 & x\notin\mathbb{Q} \end{cases}$$ We can calculate the upper integral and lower integral, $\overline{\int}f\left(x\right)dx=0.5$, $\underline{\int}f\left(x\right)dx=0$, therefore, the Riemann's criterion does not hold. So the function is not Riemann inegrable.

But if you use the Lebesgue theorem, bounded function on [a, b] is Riemann integrable if and only if the set of discontinuities of $f\left(x\right)$ has measure zero.

We know that (1) every finite set has measure zero, and (2) every countable subset of $\mathbb{R}$ has measure zero.

The rational numbers $\mathbb{Q}$ is a countable subset of $\mathbb{R}$, and the rational numbers $\mathbb{R}\setminus\mathbb{Q}$ is a countable subset of $\mathbb{R}$.

Hence, the set of discontinuities of $f\left(x\right)$ on [0, 1] has measure zero. Therefore $f\left(x\right)$ is Riemann integrable.

What are the mistakes here? Thank you very much.

• No, $f$ is discontinuous at every point of $(0,1]$ – zhw. Aug 9 '18 at 0:36
• $\mathbb{R} \setminus \mathbb{Q}$ isn't countable! – Hans Lundmark Aug 9 '18 at 10:53

well, your discontinuities are a lot more than $$\mathbb{Q}\cap [0,1]$$ they are in fact all of $$[0,1]$$, since it is the boundary that matters. or show me one point apart from $$0$$ where your function is continuous!
• The function is continuous at $x=0$ – JavaMan Oct 31 '18 at 14:01