Does the Riemann integral of the following function equal 0 ?  Does the Riemann integral of the following function equal $0$?
$$ f(x) = 
\left\{
  \begin{array}{ll}
   1 , & \hbox{if } x=\frac{1}{n};\\
   0 , & \hbox{otherwsie.}
  \end{array}
\right.
$$
I need to prove it is integrable; now I can do that with Darboux. But I also tried with Riemann sums and got that the integral is $0$ in the interval $(0,1)$. but I am not so sure I was doing it right...
 A: Choose a partition of [0,1] where you take the first interval to be $[0,\varepsilon]$ and then choose tiny intervals surrounding each of the (finitely) many discontinuities that are not included in the first interval. The rest of the interval will contain relatively speaking large intervals where the function is 0.
Compute the lower and upper sums corresponding to this partition and see that their difference is small. (You need to fix some particular choices for the lenghts of the intervals involved, but I leave that up to you; after all it's homework.)
A: For homework, are you allowed to quote a general theorem? Let $f$ be defined on a closed interval $[a,b]$, and Lebesgue proved that if $f$ is defined on a closed (finite) interval, and bounded. Then $f$ is Riemann integrable if and only $f$ is  continuous except possibly on a set of measure $0$. Your function qualifies. 
If a proof is needed, a sketch of a proof of the Lebesgue result can be found here. You can probably adapt and simplify the proof in your special case,  since $f$ is quite uncomplicated. 
