Let $f:\mathbb R\to\mathbb R$ have a continuous second derivative. Suppose for all $s,t \in \mathbb R$ with $s<t$ we have $$\frac1{t-s}\int_s^tf(x)\,dx=\frac{f(s)+f(t)}2.$$ Show there exist $\alpha$ and $\beta$ such that $f(x)=\alpha x+\beta$.
I think I use second fundamental theorem of calculus or I use the mean value theorem of integrals. Another thing I thought is the right hand side is the midpoint between two functions; so I think the function has to have the midpoint of the two endpoints involved.
Since $\int_s^t fdx=(t-s)(f(t)+f(s))/2$, differentiating with respect to $t$ gives $f(t)=(f(t)+f(s))/2+(t-s)f'(t)/2$ so $f(t)-f(s)=(t-s)f'(t)$. Differentiating with respect to $s$ gives $-f'(s)=-f'(t)$, so $f'$ is constant.