TITLE: Finding $f(x)$ with $\frac{1}{2a}\int_{x-a}^{x+a}f(t)dt=f(x)$
QUESTION [7 upvotes]: Problem
Let $f(x)$ be a differentiable function with $f(0)=1$ and $f(1)=2$. For any $a,x$ where $a \neq 0$, it holds $$\frac{1}{2a}\int_{x-a}^{x+a}f(t)dt=f(x).$$
Find $f(x)$.
Attempt
Since
$$f(x)=\frac{\displaystyle\int_{x-a}^{x+a}f(t)dt}{2a}$$
holds for all $x \in \mathbb{R}$ and $a \neq 0$. One can fix $x$ and take the limit as $a \to 0$. Thus
$$\lim_{a \to 0}f(x)=\lim_{a \to 0}\frac{\displaystyle\int_{x-a}^{x+a}f(t)dt}{2a}=\frac{f(x+a)+f(x-a)}{2},$$
where we applied L'Hopital's rule. Thus
$$f(x)=\frac{f(x+a)+f(x-a)}{2}.$$
How to go on from here?

REPLY [3 votes]: A bit late this answer but I think it is worth mentioning it:
Applying differentiation with respect to $a$ to 

$\int_{x-a}^{x+a}f(t)dt=2af(x)$
gives
$$2f(x) = f(x+a) + f(x-a)$$

$f$ is differentiable, so differentiating wrt. $a$ again gives
$$0 = f'(x+a) - f'(x-a)$$
Since this holds true for all $a,x \in \mathbb{R}$, it is also true for $a = x$:
$$f'(2x) = f'(0) \Rightarrow f' = const. \stackrel{f(0)=1,f(1)=2}{\Longrightarrow} f(x) = 1+x$$