Limit of the sequence $\left(\sum_{k=0}^n f\!\left(\frac{k}{n^2}\right)\right)_n$.

Define $\phi : \Bbb{R} \to \Bbb{R}$ by

$$ \phi(x) = \begin{cases} \dfrac{f(x)}{x}, & x \neq 0 \\ f'(0), & x = 0 \end{cases} $$

Then $\phi$ is continuous at $0$ and $f(x) = x\phi(x)$. Now your sum reduces to

$$ s_n = \sum_{k=0}^{n} \frac{k}{n^2}\phi\left(\frac{k}{n^2}\right), $$

from which we find that

$$ \Big( \inf_{[0,1/n]}\phi \Big) \sum_{k=0}^{n} \frac{k}{n^2} \leq s_n \leq \Big( \sup_{[0,1/n]}\phi \Big) \sum_{k=0}^{n} \frac{k}{n^2}. $$

Taking $n \to \infty$, by the squeezing theorem we get

$$ s_n \to \frac{1}{2}\phi(0) = \frac{1}{2}f'(0). $$


Using the definition of the derivative + using riemann sum to rewrite the sum as an integral yields $\frac{1}{2}f'(0)$.