How to calculate the derivative of $\int_0^x \left(\frac{1}{t}-[\frac{1}{t}]\right)dt$ at $x=0$?

With the help of reuns,I can complete the proof. \begin{equation} \begin{aligned} \lim_{n\to\infty}nF\left(\frac{1}{n}\right)&=\lim_{n\to\infty}n\sum_{k=n}^\infty\int_\frac{1}{k+1}^\frac{1}{k}\left(\frac{1}{t}-\left[\frac{1}{t}\right]\right)dt\\&=\lim_{n\to\infty}n\sum_{k=n}^\infty\int_\frac{1}{k+1}^\frac{1}{k}\left(\frac{1}{t}-k\right) dt\\&=\lim_{n\to\infty}n\sum_{k=n}^\infty \left(\ln(1+\frac{1}{k})-\frac{1}{k+1}\right)\\&=\lim_{n\to\infty}n\sum_{k=n}^\infty \left(\frac{1}{k}-\frac{1}{2k^2}-\frac{1}{k+1}\right)\\&=\frac{1}{2}. \end{aligned} \end{equation} Since $$\frac{1}{n}=\sum_{k=n}^\infty \frac{1}{k(k+1)}<\sum_{k=n}^\infty \frac{1}{k^2}<\sum_{k=n}^\infty \frac{1}{k(k-1)}=\frac{1}{n-1}$$ and $$\frac{1}{n^3}\leq\sum_{k=n}^\infty\frac{1}{k^3}\leq\frac{1}{n}\sum_{k=n}^\infty\frac{1}{k^2}<\frac{1}{n(n-1)}.$$ Thanks to Martin R for reminding.

The following part is by Adam Latosiński, I just modified the typographical errors.Thanks for his help!

We still need to show that $\lim\limits_{x\rightarrow 0} \frac{F(x)}{x} = \frac{1}{2}$ also when we approach by a sequence with $x\neq\frac{1}{n}$. Let $n=[ 1/x]$, so that $\frac{1}{n+1}<x\le\frac{1}{n}$, that is $n\le\frac{1}{x}<{n+1}$. We have \begin{align} \left|\frac{F(1/n)}{1/n} - \frac{F(x)}{x}\right| &\le \left|\frac{F(1/n)}{1/n} - \frac{F(1/n)}{x}\right| + \left|\frac{F(1/n)}{x} - \frac{F(x)}{x}\right| \\ &\le F(1/n) \left|n-\frac{1}{x}\right| + (n+1) |F(1/n)-F(x)| \\ &\le F(1/n) + (n+1) \int_{x}^{\frac{1}{n}} \Big(\frac{1}{t}- \left[\frac{1}{t}\right]\Big) dt \\ &\le F(1/n) + (n+1) \int_{x}^{\frac{1}{n}} 1 \,dt \\ &\le F(1/n) + (n+1)(\frac{1}{n}-\frac{1}{n+1}) \rightarrow 0\end{align} which proves that $$ \lim_{x\rightarrow 0} \frac{F(x)}{x} = \lim_{n\rightarrow\infty} nF(\frac{1}{n}) = \frac12$$


By the Stolz-Cesaro theorem \begin{eqnarray} \lim_{n\to\infty}n F\left(\frac{1}{n}\right) &=&\lim_{n\to\infty}\frac{F\left(\frac1n\right)}{\frac1n}\\ &=&\lim_{n\to\infty}\frac{F\left(\frac1{n+1}\right)-F\left(\frac1n\right)}{\frac1{n+1}-\frac1n}\\ &=&-\lim_{n\to\infty}n(n+1)\int^{\frac{1}{n+1}}_{\frac{1}{n}} \left(\frac{1}{t} - n\right)dt \\ &=&-\lim_{n\to\infty}n(n+1)\int^{\frac{1}{n+1}}_{\frac{1}{n}} \left(\frac{1}{t} - n\right)dt \\ &=&-\lim_{n\to\infty}n(n+1)\left[\ln\left(\frac{n}{n+1}\right)-\frac1{n+1}\right] \\ &=&\frac12. \end{eqnarray}


Using $\{x\}=x-\lfloor x\rfloor$ and substituting $t\mapsto\frac1t$, then integrating by parts (multiple times for higher precision), we get $$ \begin{align} \int_0^x\left(\frac1t-\left\lfloor\frac1t\right\rfloor\right)\mathrm{d}t &=\int_{1/x}^\infty\left(\frac1{2t^2}+\frac{\{t\}-\frac12}{t^2}\right)\mathrm{d}t\\ &=\frac x2+\int_{1/x}^\infty\frac1{t^2}\,\mathrm{d}\left(\tfrac12\{t\}^2-\tfrac12\{t\}+\tfrac1{12}\right)\\ &=\frac x2-x^2\left(\tfrac12\left\{\tfrac1x\right\}^2-\tfrac12\left\{\tfrac1x\right\}+\tfrac1{12}\right)+\int_{1/x}^\infty\frac{\{t\}^2-\{t\}+\tfrac16}{t^3}\,\mathrm{d}t\\[6pt] &=\frac x2-x^2\left(\tfrac12\left\{\tfrac1x\right\}^2-\tfrac12\left\{\tfrac1x\right\}+\tfrac1{12}\right)+O\!\left(x^3\right) \end{align} $$ Therefore, $$ \lim_{x\to0}\frac1x\int_0^x\left(\frac1t-\left\lfloor\frac1t\right\rfloor\right)\mathrm{d}t=\frac12 $$