TITLE: integration as limit of a sum
QUESTION [5 upvotes]: If $f$ is continuous on $[0, 1]$ then
$$\lim_ {n\to\infty}\sum_{j=0}^{\lfloor n/2\rfloor} \frac1{n}f\left(\frac {j}{n}\right)  = ? $$
will the answer be that the limit exists and is equal to $ \int_0^1 f(x) dx$ ?

REPLY [5 votes]: Let $a_n:=\sum_{j=0}^{\lfloor \frac n2\rfloor}\frac 1nf\left(\frac jn\right)$. Then $$a_{2m}=\frac 12\frac 1m\sum_{j=0}^mf\left(\frac 12\frac jm\right),$$
hence $\lim_{m\to +\infty}a_{2m}=\frac 12\int_0^1f\left(\frac x2\right)dx$.
We have 
$$a_{2m+1}=\sum_{j=0}^m\frac 1{2m+1}f\left(\frac j{2m+1}\right).$$
Using uniform continuity of $f$, one can see that the subsequences $(a_{2m},m\geqslant 1)$ and $(a_{2m+1},m\geqslant 1)$ have the same limit, namely, 
$$\int_0^{1/2}f(t)dt.$$