[Math] Proving piecewise function is not Riemann integrable

calculusintegrationriemann sumriemann-integration

How would you prove that $f(x) = \left\{ \begin{array}{l l} \pi, & \text{if $x$ is rational}, \\ 1, & \text{if $x$ is irrational}. \end{array} \right.$
is not Riemann integrable

What I did is look at the Riemann sum when all the $x_i$ in the partitions are rational, and when they are irrational. Is this the correct way of doing this?

Best Answer

Yes, that is correct. More formally: since $\mathbf{Q}$ is dense in $\mathbf{R}$, we have that $\sup_{x\in[x_i,x_{i+1}]} f(x)=\pi$ and $\inf_{x\in[x_i,x_{i+1}]} f(x)=1$ on any interval $[x_i,x_{i+1}]\subset\mathbf{R}$, therefore the upper and lower sums don't converge to the same limit. Hence $f$ is not Riemann-integrable.


Consider the partition $P=\{a=x_1<\cdots<x_n=b\}$ of an interval $[a,b]$.

For the upper sum, we have $$U(f,P)=\sum_{i=1}^{n-1} \color{blue}{\sup_{x\in[x_i,x_{i+1}]}f(x)}\cdot (x_{i+1}-x_i)=\color{blue} \pi\sum_{i=1}^{n-1} (x_{i+1}-x_i)=\pi(b-a),$$ while the lower sum evaluates to

$$L(f,P)=\sum_{i=1}^{n-1} \color{blue}{\inf_{x\in[x_i,x_{i+1}]}f(x)}\cdot (x_{i+1}-x_i)=\color{blue} 1\cdot\sum_{i=1}^{n-1} (x_{i+1}-x_i)=b-a.$$ Since $\pi(b-a)\neq b-a$, we conclude that $U(f)\neq L(f)$ therefore $f$ is not (Riemann-)integrable (on any interval $[a,b]$).

Related Question