Show that $f(x)$ is linear if $\frac{1}{2y}\int^{x+y}_{x-y}f(t)dt=f(x)$ for all $y>0$ Let $f:\mathbb{R} \to \mathbb{R} $ be a twice differentiable function such that for all $y>0,$
$$\frac{1}{2y}\int^{x+y}_{x-y}f(t)dt=f(x)\ \ \ \ \forall\  x\in \mathbb{R}$$
Show that there exists $a, b\in \mathbb{R}$ such that $f(x)=ax+b\ \ \forall \ x\in\mathbb{R}$
I was able to get that $$f'(x)=\frac{f(x+y)-f(x-y)}{2y}\ \forall \ y>0$$
by using Newton-Leibniz rule for differentiation under the integral sign. I am not able to proceed further..Any of my further efforts ends in proving that $f(x)=f(x)$ and other such results.. 
Thanks for any answers!!
 A: If the condition
$$
\frac{1}{2y}\int^{x+y}_{x-y}f(t)dt=f(x)\ \ \ \ \forall\  x\in \mathbb{R}
$$
holds for all $y>0$, it also holds for all $y<0$.
This is because
$$
\frac{1}{2y}\int^{x+y}_{x-y}f(t)dt
=
\frac{1}{2|y|}\int^{x+|y|}_{x-|y|}f(t)dt.
$$
Differentiating this with respect to $x$ gives indeed
$$
2yf'(x)
=
f(x+y)-f(x-y)
\tag{1}
$$
as you found, but now valid for all $x\in\mathbb R$ and all $y\neq0$.
By continuity this is also valid at $y=0$.
There are probably several different approaches from here.
As it was assumed that $f$ is twice continuously differentiable, let's differentiate again.
Differentiating with respect to $y$ gives
$$
2f'(x)
=
f'(x+y)+f'(x-y).
\tag{2}
$$
Taking the $x$ and $y$ derivatives of (2) gives
$$
\begin{cases}
2f''(x)
=
f''(x+y)+f''(x-y),
\\
0
=
f''(x+y)-f''(x-y).
\end{cases}
$$
Adding these together gives $f''(x)=f''(x+y)$.
As this holds for all $x$ and $y$, we conclude that $f''$ is a constant.
(I feel there should be a way to find that the constant is zero with similar reasoning, but this conclusion is good enough. The only thing missing is elegance.)
Applying the fundamental theorem of calculus twice gives $f(x)=ax^2+bx+c$.
Now you can plug this into the original condition (or some of the derived ones) and check what you get.
You will indeed get $a=0$ and it's easy to check that any values of $b$ and $c$ work.
