Prove that $\lim_{x \rightarrow 0} \frac{1}{x}\int_0^x f(t) dt = f(0)$. 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.
 A: As $\,f\,$ is continuous, we get that
$$\int_0^xf(t)\,dt=F(x)-F(0)\;\;,\;\;\text{with}\,\,\,F'(x)=f(x)\,\,(\text{a primitive of}\,\,f\,)\Longrightarrow$$
$$\lim_{x\to 0}\frac{1}{x}\int_0^xf(t)\,dt=\lim_{x\to 0}\frac{F(x)-F(0)}{x}=F'(0)=f(0)$$
Of course, this is just what Stefan conveyed in his comment.
A: $\def\e{\varepsilon}\def\abs#1{\left|#1\right|}$As $f$ is continuous at $0$, for $\e > 0$ there is an $\delta > 0$ such that $\abs{f(x) - f(0)} \le \e$ for $\abs x \le \delta$. For these $x$ we have 
\begin{align*}
  \abs{\frac 1x \int_0^x f(t)\, dt - f(0)} &= \abs{\frac 1x \int_0^x \bigl(f(t) - f(0)\bigr)\,dt}\\
   &\le \frac 1x \int_0^x \abs{f(t) - f(0)}\, dt\\ 
   &\le \frac 1x \int_0^x \e\,dt\\
   &= \e
\end{align*}
So $\abs{f(0) - \frac 1x \int_0^x f(t)\,dt} \le \e$ for $\abs x \le \delta$, as wished.
A: 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$. 
