# Prove that $f$ is constant almost everywhere.

Let $f$ be a Lebesgue integrable function on $[0,1]$ such that for any $0 \leq a < b \leq 1$, $$\int^{\frac{a+b}{2}}_a f(x)dx = \int^b_{\frac{a+b}{2}} f(x)dx$$ Prove that $f$ is constant almost everywhere.

Hints/ideas are appreciated, thanks

The fonction $F(x) = \int_0^x f(t)dt$ is a continuous function satisfying $F(\frac{a+b}{2}) = \frac{F(a) + F(b)}{2}$ for all $a,b \in [0,1]$.
Then $F$ is linear, and by the Lebesgue differentiation theorem, we have $F' = f$ a.e., whence the result.