Define the function $f:[0,1]\to \mathbb R$ by $f(0)=0$ and $f(x)=\frac{1}{n}$ if $\frac{1}{n+1}\le x \lt \frac{1}{n};$ for $n \in \mathbb N$. Prove that $f$ is Riemann integrable on $[0,1]$.
I take $P_n=\{0,\frac{1}{n},\frac{2}{n},.....,\frac{n}{n}\}$. Then try to generalize the expression of $\sum_{i=1}^n m_i \Delta_i$ and $\sum_{i=1}^n M_i \Delta_i$ in terms of n. But here I got stuck. I am not able to show $\lim\limits_{n \to \infty}\underline{S}(f,P_n)= \lim\limits_{n \to \infty}\overline{S}(f,P_n)$.
Please tell me how to proceed further or to use different method to approach the problem.
Let $f$ be a monotone function, bounded on $\left [ a,b \right ]$. You need to show that the upper and lower Riemann sums define a real number $r$. Now, this happens if and only if for each $\epsilon > 0$ there exists a partition of the interval in subintervals of length $\delta_r$ such that $S-s = \sum \left ( M_r-m_r \right )\delta_r < \epsilon$, with $\delta_r = x_r - x_{r-1}$. Now, to the result: The maximum of $f$ in the interval $\left [ x_{r-1}, x_r \right ]$ is $f\left ( x_r \right )$, and the minimum is $f\left ( x_{r-1} \right )$. Because of that, if we name $w_r = M_r - m_r$, and we take a partition such that every subinterval is of length less than some $h$ , we obtain $S-s < \left ( \sum w_i \right )h = \left ( f\left ( b \right )-f\left ( a \right ) \right )h$, but $h$ is arbitrary, showing that the upper and lower Riemann sums define a real number, so f is integrable. Replace $f$ with your specific function, and you are done. There is no need to use that specific class of partitions.
Another (and completely overkill one) would be using the fact that the points where $f$ is discontinous form a nullset.