# Prove that the function $f$ defined by $f(x)=x$ if $x$ is rational, $f(x)=-x$ if $x$ is irrational, is not Riemann integrable on $[0,1]$

Prove that $$f(x)=\begin{cases}x & \text{ if x is rational } \\ -x & \text{ if x is irrational} \end{cases}$$ is not Riemann integrable on [0,1]
I'm trying to workout the upper integral and the lower integral. And to say that they are not equal. But got stuck in between.
Definitions that I have been using:
$$\bar{I}(f,P)=\sum_{j=0}^{n}(a_{j+1}-a_j)\sup\left \{f(x)|a_j\leq x\leq a_{j+1} \right \}$$
$$\underline{I}(f,P)=\sum_{j=0}^{n}(a_{j+1}-a_j)\inf\left \{f(x)|a_j\leq x\leq a_{j+1} \right \}$$

$$\overline{\int_{0}^{1}}f dx= \underset{\epsilon\rightarrow 0}{\lim}\sup\left \{ \overline{I}(f,P)| P\text{ is a partition on [0,1] with a mesh size}\leq\epsilon \right \}$$
$$\underline{\int_{0}^{1}}f dx= \underset{\epsilon\rightarrow 0}{\lim}\sup\left \{ \underline{I}(f,P)| P\text{ is a partition on [0,1] with a mesh size}\leq\epsilon \right \}$$

• What have you tried? In every interval of size $\epsilon$ there are contained both - irrational and rational numbers. Dec 30, 2018 at 20:49
• The function is continuous in $0$ only, so the function can't be Riemannintegrable by Lebesgue's integral criterion (if you are familiar with that).
– user370967
Dec 30, 2018 at 20:50
• Almost a duplicate. Dec 30, 2018 at 21:01

Since $$\mathbb{Q}$$ and $$\mathbb{R} \backslash \mathbb{Q}$$ are dense. In each Interval $$[a_j,a_{j+1}]$$ we have $$\sup\{f(x):x \in [a_j,a_{j+1}]\}= a_{j+1}$$ and $$\inf\{f(x):x \in [a_j,a_{j+1}]\}= -a_{j+1}$$ Therefore

$$\overline{\int_{0}^{t}}f dx=t^2/2$$,

$$\underline{\int_{0}^{t}}fdx=-t^2/2$$

Lets assume we want to calculate $$\overline{\int_{0}^{t}}f (x) dx$$. We take the partition $$Z_n=[0,\frac{t}{n},\frac{2t}{n},...,t]$$. Note that if $$a_j$$ denotes the j.th term in the partition then $$a_{j+1}-a_{j}=t/n$$ and $$t/n\to 0$$ for $$n\to \infty$$. Since the supremum of $$f$$ on each interval is $$a_{j+1}=t(j+1)/n$$ the integral equals $$\lim_{n \to \infty}\sum_{j=1}^n (t/n) \frac{t(j+1)}{n}=t^2/2.$$

• Could you please let me know your calculation for one of the integrals
– DD90
Dec 30, 2018 at 21:23
• Thank you! it works
– DD90
Dec 30, 2018 at 22:21

The upper integral is $$1$$ and the lower is $$-1$$. All you need to observe is that every non-degenerate interval contains a rational number and also an irrational number.

• Thanks but the problem is when we get the suprimum on $(a_j,a_{j+1})$ it gives $a_{j+1}$ but not 1. And also for the infimum it gives $-a_{j+1}$. So could you please explain
– DD90
Dec 30, 2018 at 20:56
• I do not understand your concerns. Dec 30, 2018 at 21:02
• The issue with my approach is that I can show that the upper integral is less than or equal to 1 but not the equality (And vice versa )
– DD90
Dec 30, 2018 at 21:08
• That is exactly the point of my answer, please try to understand its details. Dec 30, 2018 at 21:09