Prove that $f(x)= f(n) = \begin{cases} x, & \text{if $n \in Q$ } \\ -x, & \text{if $n\notin Q$ } \\ \end{cases}$

is not integrable on $[0,1]$

Here is what I got but I'm not so sure

Let $\epsilon =1/2$ , we got for all $P \in [0,1]$

$U(f,P)=1$ and $L(f,P)=-1$


$U(f,P)-L(f,P)=1-(-1)=2>1/2=\epsilon $ Thus $f$ is not integrable on $[0,1]

Is this proof correct, do I have to add anything else?

  • 1
    $\begingroup$ Looks good to me. $\endgroup$ Dec 1, 2013 at 13:05
  • 1
    $\begingroup$ For any partition of $[0,1]$ I do believe that the upper sum will be $\geq 1/2$ and the lower $\leq -1/2$... I'm a bit unsure of where you got $1$ and $-1$ from? $\endgroup$
    – Tom
    Dec 1, 2013 at 13:18
  • $\begingroup$ I just find the least upper bound and the greatest lower bound of $f(x)$ to got 1 and -1, but I guess I'm wrong, that's why I'm not so sure about the proof. Can you explain to me, why the upper sum will be ≥1/2 and the lower ≤−1/2 $\endgroup$ Dec 1, 2013 at 14:07

1 Answer 1


As was noted in the comments, you were on the right track, but your figures for $U(f,P)$ and $L(f,P)$ are incorrect. Getting the correct figures is actually where you do most of the real work in this problem.

Suppose that $P$ is a partition of $[0,1]$ with endpoints $x_0=0<x_1<\ldots<x_n=1$. For $k=1,\ldots,n$ let $I_k=[x_{k-1},x_k]$. Then

$$\sup_{x\in I_k}f(x)=x_k\qquad\text{and}\qquad\inf_{x\in I_k}f(x)=-x_k\;,$$


$$\begin{align*} U(f,P)&=\sum_{k=1}^nx_k(x_k-x_{k-1})\tag{1}\\\\ &\ge\sum_{k=1}^n\left(\frac{x_k+x_{k-1}}2\cdot(x_k-x_{k-1})\right)\tag{2}\\\\ &=\frac12\sum_{k=1}^n\left(x_k^2-x_{k-1}^2\right)\tag{3}\\\\ &=\frac12\left(x_n^2-x_0^2\right)\tag{4}\\\\ &=\frac12\;. \end{align*}$$

$(1)$ is just the definition of the upper sum. To get from $(1)$ to $(2)$, make a sketch. The sum in $(1)$ is the sum of the areas of rectangles: the $k$-th rectangle has base $I_k$ and height $x_k$, attained at its righthand edge. The diagonal line $y=x$ crosses the lefthand edge of that rectangle at height $x_{k-1}$, marking out a trapezoid whose vertices are $\langle x_{k-1},0\rangle$, $\langle x_k,0\rangle$, $\langle x_{k-1},x_{k-1}\rangle$, and $\langle x_k,x_k\rangle$. The expression inside summation $(2)$ is just the area of this trapezoid, which is clearly no greater than the area of the rectangle containing it.

If you prefer a more algebraic argument for the inequality, just note that $\frac{x_k+x_{k-1}}2$ is the average of $x_{k-1}$ and $x_k$ and therefore lies midway between them; since $x_{k-1}<x_k$, this means that $\frac{x_k+x_{k-1}}2<x_k$, and the inequality between $(1)$ and $(2)$ is then obvious.

Finally, $(3)$ is a telescoping sum: everything cancels out except what appears in $(4)$.

The calculation showing that $L(f,P)\le-\frac12$ is entirely similar. Thus, for all partitions $P$ we have


and $f$ is not Riemann integrable.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .