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! :)