A fact on C1 functions Consider $f:[0,1]\rightarrow \mathbb{R}$ and define 
\begin{equation}
\sigma_n(f):=\frac{1}{n}\sum_{k=1}^{n}f \left(\frac{k}{n}\right)
\end{equation}
for $n=1,2,\dots$
I'm trying to prove that if $f\in C^1([0,1])$, then there exists a constant (depending on the function $f$) $a(f)$ such that
\begin{equation}
\sigma_n(f)=a+\frac{\sigma_n(f')}{2n}+o\left(\frac{1}{n}\right).
\end{equation}
I have tried to use Taylor' series about $\frac{k-1}{n}$ for $k=1,\dots,n$ but I can't figure it out...it seems to be not working...
 A: It appears from the comment thread that we have an idea how to prove the result, but there's confusion over why any correct proof must use the fact that $f'$ is continuous. First we give a counterexample: A differentiable function $f$, with $f'$ continuous except at the origin, such that the conclusion is false. Then for the sake of tidiness we give a proof of the result assuming $f'$ is continuous.
At first I thought about showing that the conclusion fails for the traditional $t^2\sin(1/t)$ thing, but estimating the required $\sigma_n(f)$ and $\sigma_n(f')$ for that function made my head hurt. Decided to actually write down an example when I realized the calculations could be much simplified by building $f$ out of non-decreasing functions.
Let $\phi:\Bbb R\to\Bbb R$ be smooth and non-decreasing, with $\phi(t)=0$ for $t<-1$, $\phi(t)=1$ for $t>1$, and $\phi'(0)=1$. Let $$f_n(t)=\phi\left(100^n(t-2^{-n})\right),$$and define $$f=\sum_{n=1}^\infty 4^{-n}f_n.$$
First, $f$ is certainly continuous, so $$\sigma_n(f)\to\int_0^1f(t)\,dt.$$
Note that $f_n'=0$ on $\Bbb R\setminus I_n$, where $I_n=(2^{-n}-100^{-n},2^{-n}+100^{-n})$. Since the $I_n$ are disjoint it is clear that $f$ is differentiable except perhaps at the origin where the $I_n$ pile up, and that in fact $f'$ is continuous away from the origin. Now $$0\le f_n\le\chi_{[2^{-n}-100^{-n},\infty)};$$this shows that $$0\le f(t)\le ct^2$$near the origin, so $f$ is differentiable at the origin. So $f$ is differentiable.
Since $f_n'\ge0$ it follows that $$\sigma_{2^n}(f')\ge 2^{-n}f'(2^{-n})
\ge 8^{-n}f_n'(2^{-n})=(100/8)^n.$$So $$2^{-n}\sigma_{2^n}(f')\to\infty,$$showing that $\lim\frac1{2n}\sigma_n(f')$ does not exist.

Proof, using continuity of $f'$:
Let $\epsilon>0$. Since $f'$ is uniformly continuous there exists $N$ such that $$|f'(t)-f'(s)|<\epsilon\quad(|t-s|<1/N).$$
Assume that $n>N$. Let $a=\int_0^1 f(t)\,dt$. Now
$$\sigma_n(f)-a=\sum_{k=1}^n\int_{(k-1)/n}^{k/n}(f(k/n)-f(t))\,dt.$$If $t\in[(k-1)/n,k/n]$ then $$\begin{align}f(k/n)-f(t)&=\int_t^{k/n}f'(s)\,ds
\\&=(k/n-t) f'(k/n)+\int_t^{k/n}(f'(s)-f'(k/n))\,ds\\&=(k/n-t)f'(k/n)+E_{n,k}(t),\end{align}$$where
$$|E_{n,k}(t)|<\frac\epsilon n.$$So $$\int_{(k-1)/n}^{k/n} (f(k/n)-f(t))
=\frac1{2n^2}f'(k/n)+\int_{(k-1)/n}^{k/n}E_{n,k}(t)\,dt.$$Inserting this above shows that $$\sigma_n(f)-a=\frac1{2n}\sigma_n(f')+\sum_{k=1}^n\int_{(k-1)/n}^{k/n}E_{n,k}(t)\,dt$$and$$\left|\sum_{k=1}^n\int_{(k-1)/n}^{k/n}E_{n,k}(t)\,dt\right|<\frac\epsilon n.$$
