<s>[INST] Show that: $nf(\frac{x_1+\cdots+x_n}{n})+n\left(\frac{f(M)+f(m)}{2}-f(\frac{M+m}{2})\right) \ge f(x_1)+\cdots+f(x_n)$ I am looking for a proof of the problem as following:
Let $f(x)$ is a real continuous function that is strictly convex ($f''>0$) on $[m, M]$, let $m \le x_i \le M$, for $i=1,2,\ldots,n$ then show that:
$$nf\left(\frac{x_1+\cdots+x_n}{n}\right)+n\left(\frac{f(M)+f(m)}{2}-f\left(\frac{M+m}{2}\right)\right) \ge f(x_1)+\cdots+f(x_n)$$
Equality holds if only if $m=x_1=x_2=\cdots=x_n=M$
 [/INST] The inequality does not hold in general. For a simple counterexample, consider the convex function:
$$
  f(x) =
\begin{cases}
0  & \text{if $x \lt \frac{2}{3}$} \\
x - \frac{2}{3} & \text{if $x \ge \frac{2}{3}$}
\end{cases}
$$
and $m=0, M=1, n=3, x_1=0, x_2=x_3=1$.
Since $f(0)=f(\frac{1}{2})=f(\frac{2}{3})=0, f(1)=\frac{1}{3}$ the inequality becomes:
$$
3 f(\frac{2}{3}) + 3(\frac{f(0)+f(1)}{2} - f(\frac{1}{2})) \ge f(0) + 2 f(1)
$$
$$
\frac{1}{2} \ge \frac{2}{3}
$$
where the latter is obviously false.
For a counterexample using a strictly convex function, one can choose $f(x) = e^x$, $m = 0 \le M$, $n=3$, $x_1=0, x_2=x_3=M$. The inequality becomes:
$$
3 e^{\frac{2}{3}M} + 3(\frac{1+e^M}{2} - e^\frac{M}{2}) \ge 1 + 2 e^M
$$
$$
- \frac{1}{2} e^M + 3 e^{\frac{2}{3}M} - 3 e^\frac{M}{2} + \frac{1}{2} \ge 0
$$
The latter will fail for large enough $M$ since the dominant term $e^M$ has a negative coefficient.
</s>