Prove that $\int_{0}^{1}\mathrm{f}\left(x\right)\mathrm{d}x = 1 - \gamma$ ${\displaystyle
\mbox{I know that}\quad
\gamma =
\lim_{n\to\infty}\left[\sum_{k = 1}^{n}\frac{1}{k} - \log\left(n\right)\right]
\quad\mbox{and}\quad\gamma \in \left[0,1\right]}$.
Let $\mathrm{f}:\left[0,1\right] \to \mathbb{R}\,,\quad
x \mapsto \begin{equation}
   \mathrm{f}\left(x\right) =
   \left\{\begin{array}{lr}
     {\displaystyle\frac{1}{x} -  \left\lfloor\frac{1}{x}\right\rfloor\,,} &       {\displaystyle x>0}
     \\[2mm]
     {\displaystyle 0\,,} & {\displaystyle x = 0}
   \end{array}\right.
\end{equation}$
How can i show that
$\displaystyle\int_{0}^{1}\mathrm{f}\left(x\right)\mathrm{d}x =
1 - \gamma$.
So some of mine ideas: 
I work with Riemann-integral,so until now i have proved that the function f is Riemann-integrable. For all $n \in \mathbb{N}$ is $f$on $[\frac{1}{n},1]$ piecewise monotonous and limited, here Riemann integrable. Let $\epsilon > 0 $ and choose a $n \in \mathbb{N}$ with $\frac{1}{n} < \frac{\epsilon}{2}$ and some step functions $o_n',u_n'$ on $[\frac{1}{n},1]$ with $u_n'\le f\mid_{[\frac{1}{n},1]}  \le o_n'$ and $\int_{\frac{1}{n}}^{1} (o_n'-u_n')dx$ so i know some characterizations of the riemann integrability hence this integral exist. Now let $o_n'$ continue through the value 1 and $u_n'$ 0 on whole $[0,1]$ and i will name the function then $u_n, o_n$. So $u_n, o_n$ are step functions on $[0,1]$ with $u_n \le f \le o_n$ and $\int_{0}^{1}(o_n-u_n )dx $ = $\int_{0}^{1/n}(o_n-u_n )dx $+$\int_{1/n}^{1}(o_n-u_n )dx $ = $\int_{0}^{1/n}1dx $+$\int_{1/n}^{1}(o_n'-u_n' )dx  < \frac{1}{n} + \frac{\epsilon}{2} < \epsilon$. So f is Riemann Integrable. But i can't see how i can use this knowledge...
 A: $$\sum_{k=1}^{n}\frac{1}{k} = \int_{1}^{n+1}\frac{dx}{\lfloor x\rfloor},\quad \log(n+1)=\int_{1}^{n+1}\frac{dx}{x},\tag{A} $$
$$ H_n-\log(n+1) = \int_{1}^{n+1}\frac{x-\lfloor x\rfloor}{x\lfloor x\rfloor}\,dx=\int_{1}^{n+1}\frac{\{x\}}{x\lfloor x\rfloor}\,dx\tag{B}$$
$$\gamma=\int_{1}^{+\infty}\frac{\{x\}}{x\lfloor x\rfloor}\,dx \tag{C}$$
$$\forall N\geq 2,\quad\begin{eqnarray*} \int_{1/N}^{1}\frac{1}{x}-\left\lfloor\frac{1}{x}\right\rfloor \,dx&=&\sum_{n=2}^N\int_{1/n}^{1/(n-1)}\frac{1}{x}-(n-1)\,dx\\&=&\sum_{n=2}^{N}\log\left(1+\frac{1}{n-1}\right)-\frac{1}{n}\end{eqnarray*}\tag{D} $$ and
$$ \lim_{N\to +\infty}\int_{1/N}^{1}\frac{1}{x}-\left\lfloor\frac{1}{x}\right\rfloor\,dx = 1-\gamma $$
follows by comparing $(D)$ with
$\gamma = \sum_{n\geq 1}\frac{1}{n}-\log\left(1+\frac{1}{n}\right) $.
A: $\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,}
 \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$
\begin{align}
&\int_{0}^{1}\pars{{1 \over x} - \left\lfloor\,{1 \over x}\,\right\rfloor}
\,\dd x\,\,\,\stackrel{x\ \mapsto\ 1/x}{=}\,\,\,
\int_{1}^{\infty}{x - \left\lfloor\,x\,\right\rfloor \over x^{2}}\,\dd x =
\sum_{n = 1}^{\infty}\int_{n}^{n + 1}{x - n \over x^{2}}\,\dd x
\\[5mm] = &\
\sum_{n = 1}^{\infty}\bracks{-\,{1 \over 1 + n} - \ln\pars{n} +
\ln\pars{n + 1}}\ =\
\overbrace{\sum_{n = 1}^{\infty}\pars{{1 \over n} - {1 \over n + 1}}}
^{\ds{Telescopic\ Sum\ =\ 1}}\
-\sum_{n = 1}^{\infty}\bracks{{1 \over n} - \ln\pars{n + 1 \over n}}
\\[5mm] = &\
1 - \lim_{N \to \infty}\braces{\sum_{n = 1}^{N}{1 \over n} -
\bracks{\ln\pars{2 \over 1} + \ln\pars{3 \over 2} + \cdots +
\ln\pars{N + 1 \over N}}}
\\[5mm] = &\
1\ -\ \overbrace{\lim_{N \to \infty}\bracks{\sum_{n = 1}^{N}{1 \over n} -
\ln\pars{N}}}^{\ds{\gamma}}\ +\
\overbrace{\lim_{N \to \infty}\ln\pars{N +1 \over N}}^{\ds{=\ 0}} =
\bbx{1 - \gamma}
\end{align}
A: Here is an - almost - immediate graphical proof.
The (necessarily truncated) graphical representation of function $f$ with equation $f(x)=\frac{1}{x} -  \left\lfloor\frac{1}{x}\right\rfloor$ is as follows:

Now, switch to the figure in the answer I made here : (https://math.stackexchange.com/q/1689697) : exchanging axes, the two figures are identical ; the blue area corresponds to the area under the curve of $f$, i.e., the integral of $f$ over $(0,1)$.
