I try to solve the following problem, but I have no idea how to link bounded derivative to integral: IN Riemann Sence
Let $f:[0,1]\rightarrow \mathbb{R}$ be a differentiable function such that $|f'(x)|\leq M$ for all $x \in (0,1).$ Show that $$\Big|\int_0^1 f - \frac{1}{n} \sum_{k=1}^n f(\frac{k}{n})\Big| \leq \frac{M}{n}.$$
Hint: divide $[0,1]$ in $n$ subintervals of length $1/n$. Compare integrals in each subinterval with summands of sum. MVT will be useful.