$f(x)= 0$ for $x \notin\mathbb{Q}$, and $f(x)=1/q$ for $x=p/q$. Prove: $f$ is integrable $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.
 A: 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.
A: 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 @Did'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$. 
