<s>[INST] Prove that $\int_0^1{\left\lfloor{1\over x}\right\rfloor}^{-1}\!dx={1\over2^2}+{1\over3^2}+{1\over4^2}+\cdots.$ Question. Let
$$
f(x)=\!\left\{\,\,\,
\begin{array}{ccc} 
\displaystyle{\left\lfloor{1\over x}\right\rfloor}^{-1}_{\hphantom{|_|}}&\text{if} & 0\lt x\le 1, \\ & \\
0^{\hphantom{|^|}} &\text{if}  & x=0.
\end{array}\right.
$$
Is f(x) Riemann integrable on $[0,1]$? If it is Riemann integrable, then what is the value of the integral $\,\int_0^1{\left\lfloor{1\over x}\right\rfloor}^{-1}dx$?
An attempt: Since $f$ is increasing, non-negative and bounded the integral does exist. Choosing the partition $P=\big\{0,\frac{1}{n},\frac{1}{n-1},...,1\big\}$, we have the following  upper and lower sums 
$$
U(f,P)=\sum_{i=1}^{n-1}{1\over n-i}\left [ {1\over n-i}-{1\over n-i+1}\right] - {1\over n^2},\\L(f,P)=\sum_{i=1}^{n-1}{1\over n-i+1}\left[{1\over n-i} - {1\over n-i+1} \right].
$$ 
Simplifying we obtain
$$
U(f,P)= \sum_{i=1}^n{1\over i^2}+ {1\over n} -1, \quad
L(f,P)= 2-{1\over n}-\sum_{i=1}^n{1\over n^2}.
$$
As $n\to\infty$, $U(f,P)\to{\pi^2\over 6}-1$ and $L(f,P)\to2-{\pi^2\over 6}$. Therefore $2-{\pi^2\over 6}\le\int_0^1f(x)\,dx\le{\pi^2\over 6}-1$. Direct calculation using MATLAB shows $\int_0^1f(x)\,dx={\pi^2\over 6}-1$.
 [/INST] We observe that: if $x\in\big(\frac{1}{k+1},\frac{1}{k}\big]$, then $\frac{1}{x}\in[k,k+1)$, thus $\left\lfloor{1\over x}\right\rfloor=k$ and hence
$$
\left\lfloor{1\over x}\right\rfloor^{-1}=\frac{1}{k}, \quad \text{whenever}\,\, x\in\Big(\frac{1}{k+1},\frac{1}{k}\Big].
$$
Therefore
$$
\int_{1/n}^1{\left\lfloor{1\over x}\right\rfloor}^{-1}dx=\sum_{k=1}^{n-1}
\int_{1/(k+1)}^{1/k}{\left\lfloor{1\over x}\right\rfloor}^{-1}dx=\sum_{k=1}^{n-1}
\int_{1/(k+1)}^{1/k}\frac{1}{k}dx=\sum_{k=1}^{n-1}\frac{1}{k}\cdot\frac{1}{k(k+1)},
$$
and thus
$$
\int_0^1
{\left\lfloor{1\over x}\right\rfloor}^{-1}dx=\lim_{n\to\infty}
\int_{1/n}^1{\left\lfloor{1\over x}\right\rfloor}^{-1}dx=
\sum_{n=1}^\infty \frac{1}{n^2(n+1)}.
$$
Meanwhile
$$
\sum_{n=1}^\infty \frac{1}{n(n+1)}=\sum_{n=1}^\infty\left(\frac{1}{n}-\frac{1}{n+1}\right)=1
\quad\text{and}\quad \frac{1}{n^2}-\frac{1}{n(n+1)}=\frac{1}{n^2(n+1)}.
$$
Hence, finally
\begin{align}
\frac{1}{2^2}+\frac{1}{3^2}+\cdots+\frac{1}{n^2}+\cdots&=\sum_{n=1}^{\infty}\frac{1}{n^2}-1
=\sum_{n=1}^{\infty}\frac{1}{n^2}-\sum_{n=1}^\infty \frac{1}{n(n+1)}\\&=\sum_{n=1}^\infty
\frac{1}{n^2(n+1)}=\int_0^1
{\left\lfloor{1\over x}\right\rfloor}^{-1}dx.
\end{align}
</s>