<s>[INST] proving inequality through convexity and continuity Suppose $f$ is a continuous function. Prove $f$ is convex iff this inequality holds:
$$
\frac{f(x)+f(y)+f(z)}{3} + f(\frac{x+y+z}{3}) \ge \frac{2}{3}[f(\frac{x+y}{2}) +f(\frac{y+z}{2}) +f(\frac{z+x}{2})]
$$
if we move all the terms to the left hand side, we'll have:
$$
\frac{f(x)+f(y)+f(z)}{3} + f(\frac{x+y+z}{3})-\frac{2}{3}[f(\frac{x+y}{2}) +f(\frac{y+z}{2}) +f(\frac{z+x}{2})] \ge 0
$$
I tried to prove this statement with this assumption that f is convex. First, I used the definition of convexity for each terms of the right hand side:
$$f(\frac{x+y}{2})\le \frac{1}{2}f(x)+\frac{1}{2}f(y)$$
$$f(\frac{y+z}{2})\le \frac{1}{2}f(y)+\frac{1}{2}f(z)$$
$$f(\frac{z+x}{2})\le \frac{1}{2}f(z)+\frac{1}{2}f(x)$$
$$\Longrightarrow f(\frac{x+y}{2}) +f(\frac{y+z}{2}) +f(\frac{z+x}{2}) \le f(x)+f(y)+f(z)
$$
Then after using definition for $f(x)+f(y)+f(z)/3$ and replacing above statement in the main inequality, I obtained:
$$
\frac{f(x)+f(y)+f(z)}{3} + f(\frac{x+y+z}{3})-\frac{2}{3}[f(\frac{x+y}{2}) +f(\frac{y+z}{2}) +f(\frac{z+x}{2})] \ge f(\frac{x+y+z}{3})-\frac{f(x)+f(y)+f(z)}{3} 
$$
According to the convexity of $f$, the later expression must be nonpositive but our purpose is to prove it is nonnegative. It seems we encounter with a contradiction! I tried other types of convex combinations, but I just obtained either of parts are greater or smaller than a same term, for example this one:
first part:$$\frac{f(x)+f(y)+f(z)}{3} + f(\frac{x+y+z}{3}) \ge 2f(\frac{x+y+z}{3})$$
second part:$$2[\frac{1}{3}f(\frac{x+y}{2}) +\frac{1}{3}f(\frac{y+z}{2}) +\frac{1}{3}f(\frac{z+x}{2})] \ge 2f(\frac{x+y+z}{3})$$
I think it needs to obtain a tighter bound or maybe some new information about continuous convex functions.
 [/INST] This is not true for functions $f:\mathbb R^n \to \mathbb R$ for $n\ge2$:
Take a convex function that is zero on the boundary of the triangle $(x,y,x)$ but negative in barycenter $(x+y+z)/3$.
</s>