# $f(x)= 0$ for $x \notin\mathbb{Q}$, and $f(x)=1/q$ for $x=p/q$. Prove: $f$ is integrable [duplicate]

$f(x)= 0$ , if $x \notin \mathbb{Q}$, otherwise $f(x)=1/q$ for $x=p/q$ such that $p$ and $q$ don't share common divisor. I 'd love your help proving that $f$ is integrable and that $\int_{0}^{1}f=0$.

I showed that the lower Darboux sum is $0$ and I basically need to show that for every epsilon we can find division such that the upper Darboux sum is smaller than the given epsilon.

The upper darboux sum is $\bar{S}=\sum_{1}^{n}f(x_i) \Delta x_i$ for all $x_i$ of the partition, I tried to replace the $f(x_i)$ in $1/q_i$, and check if this series converges to $0$.

Thanks a lot.

-

## marked as duplicate by Najib Idrissi, amWhyFeb 18 at 13:18

HINT: Did you try to calculate the upper Darboux sum corresponding to the uniform partition into $n$ equal parts? Attempt this and tell us where you are stuck. –  Srivatsan Jan 21 '12 at 14:27

The OP was stuck with using the definition of the Darboux integral; to proceed we need some nontrivial estimates about the function. (I have tried to maintain notational consistency with Didier Piau's answer.)

Consider the uniform partition of the unit interval into $N$ parts. Fix some $n$ (whose value will be decided shortly), and define $X_n$ to be the set of points $x$ such that $f(x) \geqslant \frac{1}{n}$. Then $|X_n| \leqslant n^2$ (why?), and so at most $n^2$ of the $N$ subintervals contain a point from $X_n$.

For each of the subintervals containing a point from $X_n$, we upper bound the function by $1$; for the remaining subintervals we upper bound it by $\frac{1}{n}$. Therefore the Darboux sum is at most $$\left( n^2 + (N - n^2) \cdot \frac{1}{n} \right) \cdot \frac{1}{N} \leqslant \frac{n^2}{N} + \frac{1}{n}.$$ Now picking $n = N^{1/3}$, the Darboux sum is at most $O ( N^{-1/3} )$, which approaches $0$ as $N \to \infty$.

-

Using Darboux sums is allright, of course, but here is a shortcut.

For every positive integer $n$, let $X_n$ denote the set of points $x$ such that $f(x)\geqslant1/n$. Then $X_n$ is finite and $f\leqslant f_n$, where $f_n=1/n+(1-1/n)\mathbf 1_{X_n}$. Since every lower or upper Darboux sum of $f_n$ adapted to $f_n$ is exactly $1/n$, letting $n\to\infty$ concludes the proof.

-
"Since every lower or upper Darboux sum of $f_n$ adapted to $f_n$" -- Can you clarify what this means? –  Srivatsan Jan 21 '12 at 14:33
What is $\mathbf 1_{X_n}$? –  Jozef Jan 21 '12 at 14:34
The indicator function. $\mathbf 1_A(x)=1$ if $x\in A$ and $\mathbf 1_A(x)=0$ if $x\notin A$. –  Did Jan 21 '12 at 14:35
@Srivatsan: Darboux sums are based on subdivisions. A subdivision is adapted to a step function if it contains every discontinuity point of the function. –  Did Jan 21 '12 at 15:02
Thanks for the clarification. And quite nice approach, by the way! (+1) –  Srivatsan Jan 21 '12 at 15:06