Computing $\lim\limits_{n\to\infty}n\bigl(a_n-\int_0^1f^2(x)\,dx\bigr)$ given a function $f\in\mathcal{C}^1([0, 1])$ 
Let $f : [0, 1] \to \mathbb{R}$ be a continuous function and $(a_n)_{n \geq 1}$ a sequence defined by $$a_n = \sum_{k=1}^{n} \biggl( f\left(\frac{k-1}{n}\right)\int_{\frac{k-1}{n}}^{\frac{k}{n}}f(t) \, dt\biggr), \qquad \forall n \in \mathbb{N}^{*}.$$
a) Prove that $\lim\limits_{n \to \infty}a_n = \int_0^1f^2(x)dx$
b) Furthermore, if $f \in \mathcal{C}^1([0, 1])$ (differentiable with its derivative continuous), compute: $$\lim_{n\to\infty} n\left( a_n - \int_0^1 f^2(x) \, dx \right)$$

Since $f$ is a continuous function, then there exists an antiderivative of $f$ such that $F : [0, 1] \to \mathbb{R}$, $F'(x) = f(x)$. Therefore,
$$
\int_{\frac{k-1}{n}}^{\frac{k}{n}}f(t)dt = F\left(\frac{k}{n}\right) - F\left(\frac{k-1}{n}\right).
$$
From this, we deduce that:
$$
a_n = \sum_{k =1}^n f\left(\frac{k-1}{n}\right)\left[F\left(\frac{k}{n}\right) - F\left(\frac{k-1}{n}\right)\right]
$$
Using Lagrange's Mean Value Theorem, one can easily see that there exists $c_{k, n} \in \bigl( \frac{k-1}{n}, \frac{k}{n} \bigr)$, so that:
$$\frac{F(\frac{k}{n}) - F(\frac{k-1}{n})}{\frac{k}{n} - \frac{k-1}{n}} = F'(c_{k, n}) = f(c_{k, n})$$
Using this, we obtain that:
$$
a_n = \frac{1}{n}\sum_{k=1}^n f\left(\frac{k-1}{n}\right)f(c_{k, n})
$$
Note that $c_{k, n} \in \bigl( \frac{k-1}{n}, \frac{k}{n} \bigr)$, and $\left| f(c_{k, n}) - f\bigl(\frac{k-1}{n}\bigr) \right| \leq \epsilon, \forall \epsilon > 0$ and $n$ sufficiently large since $f$ is a continuous function. Then, by choosing $\Delta = (x_0, x_1, \dots, x_n) \in \mathcal{D}([0, 1])$, with $x_k = \frac{k}{n}$, we realize that $\|\Delta\| = \frac{1}{n}$, and then by choosing $\xi_k \in [x_{k - 1}, x_k]$, $a_n$ is precisely the Riemann sum, thus because $f$ is Riemann integrable, and by Lebesgue's criterion, $f\cdot f = f^2$ is Riemann integrable:
$$
\lim_{n \to \infty}a_n = \int_0^1 f^2(x) \, dx
$$
Thus concluding a). Now, my problem is that I am stuck at b). The given limit obviously screams for the Stolz–Cesàro lemma to be applied, however when I try to apply the Lagrange Mean Value theorem again to reduce the differences of antiderivatives, I cannot seem to get an idea of how to reduce terms like $\frac{k}{n}$ and $\frac{k}{n + 1}$, where the denominator is different. My idea would be to write:
$$
L = \lim_{n \to \infty} \frac{a_n - \int_0^1f^2(x) \, dx}{\frac{1}{n}}
$$
And instead computing:
$$L = \lim_{n \to \infty} \frac{a_{n+1} - a_n}{\frac{1}{n + 1} - \frac{1}{n}}$$
Any ideas, hints or solutions would be of very much help. Thank you very much! :)
 A: We have
$$
 A_n := n\left(a_n - \int_0^1f^2(x) \, dx \right)
= -n \sum_{k=1}^n \int_{(k-1)/n}^{k/n} \left( f(x) - f(\frac{k-1}{n})\right) f(x) \, dx  \, .
$$
For each $x \in  [\frac{k-1}{n}, \frac{k}{n}]$ is, with some $c \in  (\frac{k-1}{n}, x)$
$$
\begin{align}
f(x) - f(\frac{k-1}{n}) &= \left( x - \frac{k-1}{n}\right) f'(c)
\\
&= \left( x - \frac{k-1}{n}\right) f'(x)
+ \left( x - \frac{k-1}{n}\right) (f'(c)-f'(x)) \\
&= \left( x - \frac{k-1}{n}\right) f'(x) + o\left( \frac 1n \right)
\end{align}
$$
because  $f'$ is uniformly continuous on the compact interval $[0, 1]$ so that, given $\epsilon > 0$, $ |f'(c) - f'(x)| < \epsilon$
for sufficiently large $n$ and all $x, c \in  [\frac{k-1}{n}, \frac{k}{n}]$.
It follows that
$$
A_n = -n \sum_{k=1}^n \int_{(k-1)/n}^{k/n} \left( x - \frac{k-1}{n}\right)f'(x) f(x) \, dx + o(1)
$$
for $n \to \infty$. Next, doing integration by parts,
$$
\int_{(k-1)/n}^{k/n} \left( x - \frac{k-1}{n}\right)f'(x) f(x)
= \frac 12\left(\frac 1n  f^2(\frac kn) 
- \int_{(k-1)/n}^{k/n}   f^2(x) \, dx \right) \, .
$$
Putting this into the previous expression for $A_n$ we get
$$
 A_n = - \frac 12 \left( \sum_{k=1}^n f^2(\frac kn)  - n\int_0^1 f^2(x) \, dx \right) + o(1)\, .
$$
The limit of that expression is well-known, see for example Limit of a Riemann Sum and Integral:
$$
 \lim_{n \to \infty} \left(\sum_{k=1}^n f^2(\frac kn)  - n\int_0^1 f^2(x) \, dx \right) = \frac {f(1)^2 - f(0)^2}{2}
$$
and therefore
$$
\lim_{n \to \infty} A_n = \frac {f(0)^2 - f(1)^2}{4} \, .
$$
