Obtain the value of $\int_0^1f(x) \ dx$, where $f(x) = \begin{cases} \frac {1}{n}, & \frac{1}{n+1}
Is the function Riemann integrable? If yes, obtain the value of $\int_0^1f(x) \ dx$
$f(x) =
\begin{cases}
\frac {1}{n},  & \frac{1}{n+1}<x\le\frac{1}{n}\\
0, & x=0
\end{cases}$
My attempt
$f$ is bounded and monotonically increasing on $[0,1]$. Also, $f$ has infinite discontinuities but only one limit point. Therefore $f$ is Riemann integrable. Now, to calculate the integration
$\int_0^1f(x) \ dx=\int_{1/2}^{1}1 \ dx + \int_{1/3}^{1/2}\frac{1}{2} \ dx + \int_{1/4}^{1/3}\frac{1}{3} \ dx+...$
$=\sum_{n=1}^\infty \frac{1}{n^2}-\frac{1}{n}+\frac{1}{n+1}$
How do I proceed from here? How do I calculate these summations? I know $\sum \frac{1}{n}$ is $\log 2$, but not the other two summations.
 A: Yes, it is Riemann integrable and 
$$\int_0^1 f(x) dx=\sum_{n=1}^{\infty}\frac{1}{n}\left(\frac{1}{n}-\frac{1}{n+1}\right)=\sum_{n=1}^{\infty}\frac{1}{n^2}-\sum_{n=1}^{\infty}\frac{1}{n(n+1)}=\frac{\pi^2}{6}-1.$$
where we used the Basel problem and  Mengoli's telescopic series.
A: Since
$$
(0,1]=\bigcup_{n=1}^\infty\left(\dfrac{1}{n+1},\dfrac{1}{n}\right]=\bigcup_{n=1}^\infty I_n,
$$
and
$$
I_n\cap I_m=\emptyset\quad \forall m,n\in \mathbb{N},
$$
we have
\begin{eqnarray}
\int_0^1f(x)\,dx&=&\int_{[0,0]}f(x)\,dx+\int_{(0,1]}f(x)\,dx\\
&=&\sum_{n=1}^\infty \int_{I_n}f(x)\,dx\\
&=&\sum_{n=1}^\infty\dfrac{1}{n}\left(\dfrac{1}{n}-\dfrac{1}{n+1}\right)\\
&=&\sum_{n=1}^\infty\dfrac{1}{n^2}-\sum_{n=1}^\infty\dfrac{1}{n(n+1)}\\
&=&\sum_{n=1}^\infty\dfrac{1}{n^2}-\sum_{n=1}^\infty\left(\dfrac{1}{n}-\dfrac{1}{n+1}\right)\\
&=&\dfrac{\pi^2}{6}-1
\end{eqnarray}
A: since $(0,1) = \bigcup_{n=1}^{\infty} ( \frac1{n+1} , \frac1{n })$. (pairwise disjoint union)
$$\int_{0}^1f(x)dx  = \sum_{n=1}^{ \infty} \int_{1/n+1}^{1/n}f(x)dx  =  \sum_{n=1}^{ \infty} \int_{1/n+1}^{1/n}\frac1ndx=\sum_{n=1}^{ \infty}  \frac1{n^2 }-     \frac1{(n+1)n}= \frac{\pi^2}{6}-1
$$ 
Given that $ \frac1{(n+1)n}= \frac1{n}- \frac1{n+1}$ then 
$$\sum_{n=1}^{ \infty} \frac1{(n+1)n}=\sum_{n=1}^{ \infty}  (\frac1{n}- \frac1{n+1})=1$$
