# Find the Riemann integral of the following function.

Define $f$ on $[0,1]$ by $$f(x)=\begin{cases}x^2 ~~\text{if x is rational}\\ x^3 ~~\text{if x is irrational}\end{cases}$$ Then

1. $f$ is not Riemann integrable on $[0,1]$
2. $f$ is Riemann integrable and $\int_{0}^{1}f(x)dx=\frac{1}{4}$
3. $f$ is Riemann integrable and $\int_{0}^{1}f(x)dx=\frac{1}{3}$
4. $\frac{1}{4}=\underline\int_{0}^{1}f(x)dx< \overline\int_{0}^{1}f(x)dx=\frac{1}{3}.$

I have not solved this kind of problems before in Riemann integration. So I have no idea how to approach. Few thoughts that came to my mind are like- if somehow I prove that the function is not continuous then option 1 is true. For checking the upper sum and lower sum, I have to partition the interval and calculate. But I am confused about, if the intervals end with rational points, then how to take care of the irrational part of the function? Please, any kind of help in solving and understanding this problem will be greatly helpful. Thanks

• Although there are a lot of great answers here, you have to understand that your original attempt is flawed since a function can be discontinuous but integrable. For example, the characteristic function of the Cantor set is discontinuous on $[0,1]$ at each point of the Cantor set, but it is integrable on $[0,1]$. May 11 '17 at 10:18

Option $1$ and $4$ are correct
If you partition the interval $[0,1]$ into disjoint intervals, however small it may be there is always an irrational number and a rational number inside it,
So in every interval of the partition the maximum is obtained from the rationals as $x^3<x^2$ in the interval $(0,1)$, so the lower integral is the integration of $x^3$ from $0$ to $1$ and the upper integral is basically the integration of $x^2$ from $0$ to $1$ which are different, hence it's also not Riemann integrable.
Note for starters that $y^3<y^2$ except at the endpoints. The lower Riemann sum for a partition, as found in Baby Rudin 6.1, will be the sum of a bunch of infimums of $f$ over the intervals in the partition, each infimum multiplied by the length of the interval. Since every interval $(x_1,x_2)$ of nonzero length contains a lot of irrationals, that infimum will be $x_1^3$. The upper Riemann sum for a partition is the sum of a bunch of suprema of $f$ over the intervals of the partition, each multiplied by the length of the interval. Because that selfsame interval of nonzero length $(x_1,x_2)$ contains a bunch of rationals, the supremum will be $x_2^2$. Now, the lower Riemann sum is the same as the lower Riemann sum for $x\mapsto x^3$, and the upper Riemann sum is the same as the upper Riemann sum for $x\mapsto x^2$. I think that your item 4 follows from this, and item 1 follows from item 4.