Riemann integral of $ f(x) = \begin{cases} \frac{1}{n}, & \text{if $x=\frac{1}{n}, \ \ n=1, 2,3 ,\cdots$ } \\ 0, & \text{other where} \end{cases}$ Let $f:[0, 1]\to\mathbb{R}$ and $  f(x) =
\begin{cases}
\frac{1}{n},  & \text{if $x=\frac{1}{n}, \  \ n=1, 2,3 ,\cdots$ } \\
0, & \text{other where}
\end{cases}$
I want to find $\int_{0}^{1} f\, dx.$ I think the answer is $0$.
Any ideas or insight would be greatly appreciated

For any $\epsilon > 0$, choose $n > \dfrac{2}{\epsilon}$,  define a partition $P_n = \{0,\dfrac{1}{n}, 1-\dfrac{1}{n}, 1\}$, we have: $U(f,P_n)-L(f,P_n)= \dfrac{1}{n}\left(\dfrac{1}{n}-0\right)+0\left(1-\dfrac{1}{n}-\dfrac{1}{n}\right)+1\left(1-\left(1-\dfrac{1}{n}\right)\right)- 0= \dfrac{1}{n}+\dfrac{1}{n^2}< \dfrac{2}{n}< \epsilon$. Thus $f$ is Riemann integrable on $[0,1]\Rightarrow \displaystyle \int_{0}^1 f(x)dx = \displaystyle \lim_{n\to \infty} U(f,P_n) = \displaystyle \lim_{n\to \infty} \left(\dfrac{1}{n}+\dfrac{1}{n^2} \right)= 0$.
