If a function $g$ has a continuous second derivative and satisfies
$$ \frac{1}{x-c}\int_c^x g(t)\ dt=g(\frac{c+x}{2}), $$
for all $c\in [a, b)$ and $x\in(c, b]$. Then it follows that $g$ is linear.
If $g''$ is discontinuous, then $g$ must be non-linear. However, is there any example of $g$ that satisfies the above equation in this case?