Limit of $a_n = \sum\limits_{k=1}^{n} \left(\sqrt{1+\frac{k}{n^2}}-1\right)$ 
Given $a_n =  \sum\limits_{k=1}^{n} \left(\sqrt{1+\frac{k}{n^2}}-1\right)$, find $\lim\limits_{n \to \infty} a_n$.

My try: To simplify, $$a_n = \frac{\displaystyle\sum_{k=1}^{n}\sqrt{n^2+k}-n}{n}$$ and I'm stuck from there. In addition, I have made a program to find the limit, which says it's 1/4. 
Can anybody give me a hint to start? Thanks for your time!

Generalization
Suppose $f$ is differentiable at $x=0$ with $f(0)=0$ and consider, for all $n\in\mathbb{N}^\star$ :
$$S_n=\sum_{k=1}^nf\left(\frac{k}{n^2}\right)$$
Then we have :

$$\lim_{n\to\infty}S_n=\frac{1}{2}f'(0)$$

It's relatively easy to prove this, using a Taylor expansion. We know that :
$$f(x)=\underbrace{f(0)}+xf'(0)+x\alpha(x)$$
with $\lim_{x\to 0}\alpha(x)=0$. Hence :
$$S_n=\frac{f'(0)}{n^2}\sum_{k=1}^{n}k+\frac{1}{n^2}\sum_{k=1}^nk\,\alpha\left(\frac{k}{n^2}\right)$$
The first piece has limit $\frac{1}{2}f'(0)$ because $\sum_{k=1}^nk=\frac{n(n+1)}{2}$.
We prove now that the second piece has limit $0$ :
Given $\epsilon>0$, there exists $\delta>0$ such that :
$$\forall x\in\mathbb{R},\vert x\vert\le\delta\implies\left|\alpha(x)\right|\le\epsilon$$
If $n$ is large enough (and $n\ge\frac{1}{\delta}$ is enough), we have :
$$\forall k\in\{1,\cdots,n\},\,0\le\frac{k}{n^2}\le\frac{1}{n}\le\delta\;\mathrm{and}\;\mathrm{therefore}\;\left|\alpha\left(\frac{k}{n^2}\right)\right|\le\epsilon$$
so that :
$$\left|\frac{1}{n^2}\sum_{k=1}^nk\,\alpha\left(\frac{k}{n^2}\right)\right|\le\frac{1}{n^2}\sum_{k=1}^nk\,\left|\alpha\left(\frac{k}{n^2}\right)\right|\le\frac{\epsilon}{n^2}\frac{n(n+1)}{2}=\frac{\epsilon(n+1)}{2n}\le\epsilon$$
