The problem is following:
$${f}(x) = \begin{cases} 1, & \text{if $x=\frac{1}{n}, \ \ n=1, 2,3 ,\cdots$ } \\ 0, & \text{if else} \end{cases}$$
I'm supposed to prove that this function is Riemann integrable over $[0,1]$. I know that this exact problem has been posted here before, but I still don't understand the solutions. In the types of problems I have been working with until now, I have been given a partition. So it has been easy to just calculate $$U(f,P)-L(f,P)<\epsilon $$ I have been looking at the solution my textbook provide, but I find it hard to understand what they are saying. The solution is:
If P is any partition of $[0,1]$ the $L(f,P)=0.$ Let $0\leq\epsilon\leq2$. Let N be an integer such that $N+1>\frac{2}{\epsilon}\geq N$. A partition P of $[0,1]$ can be constructed so that the first two points of P are 0 and $\frac{\epsilon}{2}$, and such that each of the N points $1/n$ lies in a subinterval of P having length at most $\frac{\epsilon}{2N}$. Since every number $1/n$ lies either in $[0,\epsilon/2]$ or one of these N subintervals of P, and since max $f(x)=1$ for these subintervals and max $f(x)=0$ for all other subintervals of P, and therefor $U(f,P)\leq \epsilon/2+N*\epsilon/2N=\epsilon$.
I don't understand anything when reading this solution. The only thing I understand is the first sentence. What does N mean? How do they find these inequalities and lenght of the interval?
Suppose we have the series $x_n=\frac{1}{n}$. The idea in the proof given, is to construct a partition such that one of the intervals is $[0,\epsilon/2]$. This interval contains all $x_k$ with $k>N$.
Now, refine your partition such that for $k<N$, $x_k$ lies in the interval $[x_k-\epsilon/2N,x_k+\epsilon/2N]$. Note that there exists only finitely many $k$ with $k<N$.
Since $f(x)=1$ only when $x=x_k$ for some $k$,while calculating $U(f,P)$ we need to consider only the intervals of the partition that contain $x_k$. Doing that calculation gives $\epsilon$ as in the problem.
Drawing a picture representing the partitions and $x_k$ would give you a better intuition for the proof.