TITLE: Prove that $f(ax + (1-a)y) = \frac{1}{y-x}\int_x^y f(t)dt$ implies $a = \frac{1}{2}$
QUESTION [11 upvotes]: Let $f: \mathbb{R} \to \mathbb{R}$ be a non-constant function, integrable on every interval $[x,y] \subset \mathbb{R}$ and $a \in \mathbb{R}$ such that $$f(ax + (1-a)y) = \frac{1}{y-x}\int_x^y{f(t)dt}, \quad \forall x<y$$
  Prove that $\displaystyle a = \frac{1}{2}$.

This is a small part from another problem. If I can prove that $\displaystyle{a = \frac{1}{2}}$ then the whole problem is solved, but I don't know how.
Edit:
If $f$ is integrable, then the function $F : \mathbb{R} \to \mathbb{R}, F(x) = \displaystyle{\int_m^x{f(t)dt}}, m \in \mathbb{R}$ is continuous. Since we have that $\displaystyle{f(ax + (1-a)y) = \frac{1}{y-x}\int_x^y{f(t)dt}, \forall x<y}$, then $f$ is continuous and $F$ is differentiable. This implies that $f \in C^{\infty}(\mathbb{R})$.
If $\displaystyle{a = \frac{1}{2}}$, then $\displaystyle{f\left(\frac{x+y}{2}\right) = \frac{1}{y-x}\int_x^y{f(t)dt}, \forall x < y}$. So we have equality in the Hermite-Hadamard inequality, which is achieved when $f$ is linear on that interval.

REPLY [4 votes]: We know $f$ is differentiable on $\mathbb R.$ If $f$ is constant, then any $a$ will work.
If $f$ is not constant, then $f'(x_0)\ne 0$ for some $x_0.$ For simplicity, assume at first that $x_0 = 0$ and $f(0)=0.$ Then $f(y) = f'(0)y + o(y)$ as $y\to 0.$ It follows that
$$\tag 1 f((1-a)y) = f'(0)(1-a)y + o(y)\,\,\text {as } y\to 0.$$
We also have
$$ f((1-a)y) = f(a\cdot 0 +(1-a)y) = \frac{1}{y}\int_0^y f(t)\,dt$$ $$\tag 2 = \frac{1}{y}\int_0^y (f'(0)t + o(t))\,dt = \frac{1}{y}(f'(0)y^2/2 + o(y^2))= f'(0)y/2 +o(y).$$
Equating $(1)$ with the last expression in $(2),$ and finally using $f'(0)\ne 0,$ we obtain $1-a=1/2,$ and thus $a=1/2,$ as desired.
What about the assumption $x_0 =0=f(x_0)?$ This special case implies the general case, simply because if $f$ has the given property, then so does $x\to f(x+d)+c$ for any constants $c,d.$