TITLE: Prove that $\lim_{x \rightarrow 0} \frac{1}{x}\int_0^x f(t) dt = f(0)$.
QUESTION [7 upvotes]: Assume $f: \mathbb{R} \rightarrow \mathbb{R}$ is continuous.  Prove that $\lim_{x \rightarrow 0} \frac{1}{x}\int_0^x f(t) dt = f(0)$.
I'm having a little confusion about proving this.  So far, it is clear that $f$ is continuous at 0 and $f$ is Riemann integrable.  So with that knowledge, I am trying to use the definition of continuity.  So $|\frac{1}{x}\int_0^x f(t) dt - f(0)|=|\frac{1}{x}(f(x)-f(0))-f(0)|$.  From here, I'm not sure where to go.  Any help is appreciated.  Thanks in advance.

REPLY [3 votes]: We show that as $x$ approaches $0$ from the right, our expression approaches $f(0)$.  A similar argument deals with the limit from the left. The two arguments can even be combined, at the cost of intelligibility.
For $x\gt 0$, let  $M_x$ be the maximum of $f(t)$ in the interval $0\le t\le x$, and let $m_x$ be the minimum of $f(t)$ in this interval. By basic properties of the Riemann integral, we have 
$$xm_x \le \int_0^x f(t)\,dt \le xM_x,$$
or equivalently
$$m_x\le \frac{1}{x}\int_0^x f(t)\,dt \le M_x.$$
Now let $x\to 0$. As $x$ approaches $0$, both $m_x$ and $M_x$ approach $f(0)$, and therefore by Squeezing so does $\frac{1}{x}\int_0^x f(t)\,dt$.