Is this function Riemann integrable on $[0,1]$? Is this function Riemann integrable on $[0,1]$?
$$f(x)=\begin{cases}
x, & x \text{ is rational}, \\
-x, & x \text{ is irrational}, \\
\end{cases}$$
I feel this is not Riemann integrable. I want to use the Riemann integrability criterion, if $[0,1]$ is divided into $n$ equal parts
$$U(P_n,f)-L(P_n,f)= \sum 2x_i\Delta x_i$$
where $i=1,2,3,\dots= 2(1^2-0^2)+\frac{1}{2n})=1+\frac{1}{n}>1$.
So if you chose epsilon as 1 then I wanna show you cannot find any partition whose upper sum minus lower sum is less than $1$, but I get stuck here as I can show for partitions $P_n$ with length of each subinterval $b-\frac{a}{n}$ only. I am thinking of somehow using mesh here to show for any partition but I have no clue. Please help, thanks.
 A: Let $\mathcal{P}_n=\{x_0,\dots,x_n\}$ be an arbitrary partition of $[0,1]$. Now recall that
$$U(f,\mathcal{P}_n)=\sum_{i=1}^n (x_i-x_{i-1})M_i$$
and
$$L(f,\mathcal{P}_n)=\sum_{i=1}^n (x_i-x_{i-1})m_i,$$
where
$$M_i=\sup_{x\in[x_{i-1},x_i]}f(x) \quad \text{and} \quad m_i=\inf_{x\in[x_{i-1},x_i]}f(x).$$
Now since each subinterval $[a,b]\subseteq[0,1]$ with $a<b$ contains both rational and irrational numbers, it follows that
$$M_i=\sup_{x\in[x_{i-1},x_i]}f(x)=\sup_{x\in[x_{i-1},x_i]}x=x_i$$
and
$$m_i=\inf_{x\in[x_{i-1},x_i]}f(x)=\inf_{x\in[x_{i-1},x_i]}-x=-x_i.$$
We then consider the upper and lower integrals defined as
$$\overline{\int_0^1} f(x)\,\mathrm{d}x=\inf_{\mathcal{P}\in\mathscr{P}}U(f,\mathcal{P})$$
and
$$\underline{\int_0^1} f(x)\,\mathrm{d}x=\sup_{\mathcal{P}\in\mathscr{P}}L(f,\mathcal{P}),$$
where $\mathscr{P}$ is the set of all partitions of $[0,1]$. Recall that $f$ is integrable if and only if its upper and lower integrals are equal. But now notice that the upper sums of $f$ are the same as the upper sums of $x\mapsto x$, and similarly the lower sums of $f$ are the same as the lower sums of $x\mapsto -x$. As these two functions are Riemann integrable this gives us that
$$\overline{\int_0^1} f(x)\,\mathrm{d}x=\int_0^1 x\,\mathrm{d}x=1$$
and
$$\underline{\int_0^1} f(x)\,\mathrm{d}x=\int_0^1 -x\,\mathrm{d}x=-1.$$
As $1\neq -1$ it follows that $f$ is not Riemann integrable.
A: With the help of Lebesgue Criterion,
Theorem (Lebesgue's Integrability Criterion): A bounded function on $ [a, b] $ is Riemann integrable if and only if the points of discontinuity  of $f$ $( \space  \scr{D}_f \space ) $form a set $D$ of measure zero.
Here, $\scr{D}_f=[0,1]\setminus\{0\}$
Lebesgue measure  $\lambda(\scr{D}_f) =1$
Hence, $f$ is not Riemann integrable.
