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$.
 A: 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}
A: $\newcommand{\angles}[1]{\left\langle\, #1 \,\right\rangle}
 \newcommand{\braces}[1]{\left\lbrace\, #1 \,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\, #1 \,\right\rbrack}
 \newcommand{\ceil}[1]{\,\left\lceil\, #1 \,\right\rceil\,}
 \newcommand{\dd}{{\rm d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,{\rm e}^{#1}\,}
 \newcommand{\fermi}{\,{\rm f}}
 \newcommand{\floor}[1]{\,\left\lfloor #1 \right\rfloor\,}
 \newcommand{\half}{{1 \over 2}}
 \newcommand{\ic}{{\rm i}}
 \newcommand{\iff}{\Longleftrightarrow}
 \newcommand{\imp}{\Longrightarrow}
 \newcommand{\pars}[1]{\left(\, #1 \,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\pp}{{\cal P}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\vphantom{\large A}\,#2\,}\,}
 \newcommand{\sech}{\,{\rm sech}}
 \newcommand{\sgn}{\,{\rm sgn}}
 \newcommand{\totald}[3][]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\, #1 \,\right\vert}$
\begin{align}&\color{#66f}{\large%
\int_{0}^{1}\left\lfloor{1 \over x}\right\rfloor^{-1}\,\dd x}
=\int_{\infty}^{1}\left\lfloor x\right\rfloor^{-1}\,\pars{-\,{\dd x \over x^{2}}}
=\int_{1}^{\infty}{\dd x \over \floor{x}x^{2}}
\\[5mm]&=\lim_{N \to \infty}\bracks{%
\int_{1}^{2}{\dd x \over x^{2}} + \int_{2}^{3}{\dd x \over 2x^{2}}+\cdots
+\int_{N - 1}^{N}{\dd x \over \pars{N - 1}x^{2}}}
\\[5mm]&=\lim_{N \to \infty}\bracks{%
\int_{0}^{1}{\dd x \over \pars{x + 1}^{2}}
+ \int_{0}^{1}{\dd x \over 2\pars{x + 2}^{2}} + \cdots
+\int_{0}^{1}{\dd x \over \pars{N - 1}\pars{x + N - 1}^{2}}}
\\[5mm]&=\lim_{N \to \infty}\int_{0}^{1}
\sum_{k = 1}^{N - 1}{1 \over k\pars{x + k}^{2}}\,\dd x
=-\lim_{N \to \infty}\int_{0}^{1}
\partiald{}{x}\sum_{k = 0}^{N - 2}{1 \over \pars{k + x + 1}\pars{k + 1}}\,\dd x
\\[5mm]&=-\int_{0}^{1}\partiald{}{x}\bracks{\Psi\pars{x + 1} - \Psi\pars{1}\over x}
\,\dd x
=-\bracks{\Psi\pars{2} - \Psi\pars{1} - \Psi'\pars{1}}
\\[5mm]&=\Psi'\pars{1} - 1 = \color{#66f}{\Large{\pi^{2} \over 6} - 1}
\approx {\tt 0.6449}
\end{align}

$\ds{\Psi\pars{z}}$ is the Digamma Function and we used the properties
  \begin{align}
&\sum_{k = 0}^{\infty}{1 \over \pars{k + \mu}\pars{k + \nu}}
= {\Psi\pars{\mu} - \Psi\pars{\nu} \over \mu - \nu}\,,\qquad
\begin{array}{|rcl}
\ \Psi\pars{z + 1} & = & \Psi\pars{z} + {1 \over z}
\\
\Psi'\pars{1}    & = & {\pi^{2} \over 6}
\end{array}
\end{align}

