f(1/n)=1, f(x)=0 for other x. prove the integral is 0 on [0,1] the function is defined as $f(1/n)=1$ for $n=1,2,3...$ and $f(x)=0$ for all other x. How to prove that $\int_0^1 f(x)dx=0$? It is needed to use analysis argument
edit: I tried to use a partition of $Pn=[n*\frac1n,(n+1)*\frac1n]$, and for any $\varepsilon>0$ there are $2*\frac1\varepsilon$ blocks which can take value from 0 or 1. It will result in that the upper limit of the integral go to $2*\frac1\varepsilon*\varepsilon=2$, which is definitly wrong. 
 A: If you only know Riemann integral... Then your weapons are a bit less powerful!
You have to build two step functions, one below $f$ and the other one above such that the integral of their difference is as small as you want.
For the one below... Easy take the function equal to zero.
For the one above, separate the points that belong to a "small interval around zero" from the rest. On this small interval the function above $f$ is having one as a value. For the rest, there is only a finite number of points for which $f$ does not vanish. For those points take small intervals around them (all having the same length) and define the function above to take value one on those intervals. Elsewhere the function above is taking zero as a value.
I know this is only the intent. But trying to formalize this intent with precisely defined step functions is a good exercise.
A: Let's use the Riemann-Stieltjes definition of integral, as the limit, as the mesh of the partition $\left\{g\right\}$of the interval (here, $(0,1)$) goes to zero, of 
$$
\sum f(c_i) (g_{i_1} - g_i)$$
where each $c_i$ is an arbitrarily chosen sample point in interval $i$.
(The mesh of a partition is the largest interval in the partition.  If this limit does not exist, or if it depends on how we construct the partition, then the integral does not exist.)
Take as our $k$-th partition a separation into $k^2$ intervals, evenly spaced; that is, take 
$$
g_{i}^{(k)} = \frac{i}{k^2}$$ 
The mesh of this partition is $\frac{1}{k^2}$.
Choose $c_i^{(k)}$ to be 
$$c_i^{(k)} \sup_{x \in \left( g_i^{(k)}, g_{i+1}^{(k)} \right) }f(x) $$
Clearly, any choice of sample points will yield a sum less than or equal to that for this choice of $c_i^{(k)}$. 
Now let's evaluate the sum:  For $i=0$, that first integral contains (many) points at which $f(x) = 1$, so $f(c_0^{(k)} = 1$. Similarly, for all $i \leq k$, 
$f(c_i^{(k)} = 1$.  However, for $i>k$, $g_i > \frac{1}{k}$ and there are only $k$ non-zero points in the interval $[\frac{1}{k},1]$, so only a total of $2k$ of the  $c_i^{(k)}$ can be non-zero.
Thus the sum 
$$
\sum f(c_i^{(k)}) (g_{i_1}^{(k)} - g_i^{(k)})
$$is non-negative but is no greater than
$\frac{2k}{k^2} = \frac{2}{k}$.  And the limit, as the mesh $\frac{1}{k^2}$goes to zero, of the RS sum thus goes to zero at least as rapidly as $2/k$.  So the integral exists, and has value 0.
By the way, since all of our partitions are evenly spaced, this argument works for the less powerful Riemann integral definition as well.
A: Pick any $\epsilon<1$, and consider the set $A_n = \left[\dfrac1n-\dfrac{\epsilon}{2^{n}}, \dfrac1n\right]$. Let $A = \bigcup_{n=1}^{\infty} A_n \subseteq [0,1]$ and $B = [0,1] - A$. We then have
$$\int_{[0,1]} f(x) dx = \int_{A \cup B} f(x) dx = \int_A f(x) dx + \int_B f(x) fx$$
Note that on $B$, $f(x)$ is identically zero. Hence,
$$\int_{[0,1]} f(x) dx = \int_A f(x) dx \leq \int_A 1 dx = \text{Length of the set }A$$
We have
$$\vert A \vert \leq \sum_{n=1}^{\infty} \vert A_n \vert = \sum_{n=1}^{\infty} \dfrac{\epsilon}{2^{n}} = \epsilon$$
Hence, for any $\epsilon$, we have
$$\int_{[0,1]} f(x) dx \leq \epsilon \implies \int_{[0,1]} f(x) dx = 0$$
A: The set $\{1, \frac{1}{2}, \frac{1}{3} \cdots\}$ is countable.  Thus, the integral ignores this.  Function that are the same on all but a countable set are identified under the integral. 
