An inequality in positive real continuous function

What if you fix $\epsilon>0$ and consider $f:[0,3]\rightarrow\mathbb{R}$ defined by $f(x) = (x-1)^2 + \epsilon$? So $m=0, M=3$. Let $x_1=0, x_2=2$. So:

\begin{align} \frac{f(x_1)+f(x_2)}{2} &= \frac{f(0)+f(2)}{2} = 1 + \epsilon\\ f(\frac{x_1+x_2}{2}) &= f(1) = \epsilon \\ \frac{f(M)+f(m)}{2} &= \frac{f(3)+f(0)}{2} = (5/2)+\epsilon\\ f(\frac{M+m}{2}) &= f(1.5) = (1/4)+\epsilon \end{align}

So for a counter-example to your conjecture, we just find an $\epsilon>0$ such that: $$ 1+\epsilon > \left(\frac{(5/2)+\epsilon}{(1/4)+\epsilon}\right)\epsilon $$ which is true for all sufficiently small $\epsilon>0$.


You made a second conjecture in the comment to my first answer, so I am answering that here. The conjecture is:

Conjecture:

$$ \frac{f(x_1)+...+f(x_n)}{n} - f(\frac{x_1+...+x_n}{n}) \leq \frac{f(M)+f(m)}{2}- f(\frac{M+m}{2}) $$ whenever $f$ is continuous and convex over the interval $[m,M]$ and $m \leq x_i\leq M$ for all $i$.

Counter-example:

Consider $m=0,M=1$. Consider $f:[0,1]\rightarrow\mathbb{R}$ defined with 2 piecewise linear segments over the intervals $[0,3/4]$ and $[3/4,1]$ with: \begin{align} f(0) &= 2\\ f(3/4) &= 1\\ f(1) &= 2 \end{align} Specifically: $$ f(x) = \left\{ \begin{array}{ll} -(4/3)x + 2 &\mbox{ if $x \in [0, 3/4]$} \\ 4x-2 & \mbox{ if $x \in [3/4,1]$} \end{array} \right. $$ Then: $$ \frac{f(M)+f(m)}{2} - f(\frac{M+m}{2})= \frac{f(1)+f(0)}{2} - f(1/2) = 2/3$$

Now let $x_1=0, x_2=x_3=x_4=1$. So: $$ \frac{f(x_1)+...+f(x_4)}{4} - f(\frac{x_1+...+x_4}{4}) = 2-f(3/4)=1$$