How to prove $f(x)=\lim_{r\to0^+}\frac{1}{2r}\int_{x-r}^{x+r} f(y)dy$ for all x using continuity I'm trying to do a proof $f(x)=\lim_{r\to0^+}\frac{1}{2r}\int_{x-r}^{x+r} f(y)dy$ for all x when $f:\mathbb{R}\to\mathbb{R}$ and $f$ is continous. 
I would like to use continuity and not the fundamental theorem of calculus. I assume it should be possible, but I don't really even know where to start.
 A: You might consider the squeeze lemma for integrals: if $g(x) \le f(x) \le h(x)$ for all $x$, then $\int_a^b g(t) dt \le \int_a^b f(t) dt \le \int_a^b h(t) dt$. This is particularly useful when the functions $g$ and $h$ vary with some parameter, and as they do so, their integrals get closer and closer. 
In this case, let's fix $x$. Because $f$ is continuous, on the interval $[x-r, x+r]$, $f$ has a maximum value $M_r$ and a minimum value $m_r$. Hence
$$
\int_{x-r}^{x+r} m_r~ dx \le \int_{x-r}^{x+r} f(x)~ dx \le \int_{x-r}^{x+r} M_r ~dx
$$
which simplifies down to 
$$
2rm_r \le \int_{x-r}^{x+r} f(x)~ dx \le 2rM_r
$$
or
$$
m_r \le \frac{1}{2r}\int_{x-r}^{x+r} f(x) ~dx \le M_r
$$
Now if you can show that $\lim_{r \to 0^{+}} m_r = \lim_{r \to 0^{+}} M_r$, you'll be done. 
Can you do that? Hint: $f$ is continuous at $x$, and we really haven't used that very strongly yet. 
A: Let $\varepsilon>0$. Since $f$ is continuous, there is a $r>0$ with $|f(x)-f(y)|<\varepsilon$ for all $y\in[x-r,x+r]$ resp. $f(y)-\varepsilon<f(x)<f(y)+\varepsilon$ for all y..
With monotonicity of the integral follows
$$\int_{x-r}^{x+r}(f(y)-\varepsilon)dy<\int_{x-r}^{x+r}f(x)dy<\int_{x-r}^{x+r}(f(y)+\varepsilon)dy$$
which leads to
$$\int_{x-r}^{x+r}f(y)dy-2r\varepsilon<2rf(x)<\int_{x-r}^{x+r}f(y)dy+2r\varepsilon.$$
Now divide by $2r$ and you obtain
$$\frac{1}{2r}\int_{x-r}^{x+r}f(y)dy-\varepsilon<f(x)<\frac{1}{2r}\int_{x-r}^{x+r}f(y)dy+\varepsilon$$
resp
$$\left|f(x)-\frac{1}{2r}\int_{x-r}^{x+r}f(y)dy\right|<\varepsilon.$$
Note that you can choose $r$ w.l.o.g. arbitrarily small.
A: We can write
$$
\int_{x-r}^{x+r}f(y)\,dy=
\int_{x-r}^{x}f(y)\,dy+
\int_{x}^{x+r}f(y)\,dy
$$
Thus, with the simple change of variables $r\mapsto -r$, it is easy to prove that
$$
\lim_{r\to0^+}\frac{1}{r}\int_{x-r}^{x}f(y)\,dy=
\lim_{r\to0^-}\frac{1}{r}\int_{x}^{x+r}f(y)\,dy
$$
(provided one of them exists).
Now, the fact that
$$
\lim_{x\to0}\frac{1}{r}\int_{x}^{x+r}f(y)\,dy=f(x)
$$
is the fundamental theorem of calculus, so in order to avoid it you have essentially to write down a proof of the theorem, which is what the other answers do.
A: By the mean value theorem (for integrals) there is $t_r \in (x-r,x+r)$ such that
$\frac{1}{2r}\int_{x-r}^{x+r} f(y)dy=f(t_r)$
Since $t_r \to x$ for $r \to 0^+$, the continuity of $f$ gives 
$\frac{1}{2r}\int_{x-r}^{x+r} f(y)dy \to f(x) $for $r \to 0^+$.
