Function that is both midpoint convex and concave

Without loss, translate so that $f(0) = 0$. Then we have

$$f(x) = f\left(\frac{2x + 0}{2}\right) = \frac{f(2x)}{2}$$

so that $f(2x) = 2 f(x)$.


Now suppose that $f$ is midpoint convex and concave. We show it satisfies the Cauchy equation:

$$f(x + y) = f\left(\frac{2x + 2y}{2}\right) = \frac{f(2x) + f(2y)}{2} = f(x) + f(y)$$ as claimed. Now just remember that multiples of solutions to the Cauchy equation are still solutions to the Cauchy equation - hence, functions with your property are exactly translates of functions which solve the Cauchy equation.