Prove that if $f:(0,+∞)→\mathbb R$ is a continuous function, then the following are equivalent for every $x\in(0,+∞)$:
(1)$\displaystyle\frac{f(x_4)-f(x_3)}{{x_4}-x_3}\leq\frac{f(x_2)-f(x_1)}{{x_2}-x_1}$, $x_4>x_3>x_2>x_1;$
(2)$\displaystyle\frac12(f(x_2)+f(x_1))\leq\frac1{x_2-x_1}\int_{x_1}^{x_2}f(u)\,\mathrm du\leq f\left(\frac{x_2+x_1}2\right).$
I know that if $f$ has the first condition, it means that $f$ is a concave function and it implies that $f$ is a midpoint concave. So we have $$\frac{1}{2}(f(x_2)+f(x_1))\leq f\left(\frac{x_2+x_1}{2}\right).$$ Moreover I know that the condition (2) along with continuity imply that $f$ is a concave function and it make the condition (1) be held. Also I know that if $f$ is a continuous function then according to fundamental theorem of calculus, the integral of $f$ is well-defined.
In addition to these mentioned, I tried to prove the above assertion with Mean value theorem fo integrals, but I could not achieve the aim. Can anyone help me?
So it remains to show that (1) $\implies$ (2). Note that, by continuity, (1) holds also for $x_4>x_3\geq x_2>x_1$.
By (1), if $x_2>t>x_1$ then $$\frac{f(x_2)-f(t)}{{x_2}-t}\leq\frac{f(t)-f(x_1)}{{t}-x_1}$$ which implies that $$(f(x_2)-f(x_1))t+x_2f(x_1)-x_1f(x_2)\leq (x_2-x_1)f(t).$$ By integrating both parts with respect to $t$ along $[x_1,x_2]$, we obtain $$(f(x_2)-f(x_1))\frac{x_2^2-x_1^2}{2}+(x_2f(x_1)-x_1f(x_2))(x_2-x_1)\leq (x_2-x_1)\int_{x_1}^{x_2}f(t)\,dt$$ that is $$f(x_2)x_2-f(x_2)x_1+f(x_1)x_2-f(x_1)x_1\leq 2\int_{x_1}^{x_2}f(t)\,dt$$ or $$\frac12(f(x_2)+f(x_1))\leq\frac1{x_2-x_1}\int_{x_1}^{x_2}f(t)\,dt.$$ Moreover, by (1), if $\mu+t>\mu>\mu-t$ where $\mu=\frac{x_2+x_1}{2}$ and $t\in [0,\frac{x_2-x_1}{2}]$, then $$\frac{f(\mu+t)-f(\mu)}{t}\leq\frac{f(\mu)-f(\mu-t)}{t}$$ which implies that $$f(\mu+t)+f(\mu-t)\leq 2f(\mu).$$ By integrating both parts with respect to $t$ along $[0,\frac{x_2-x_1}{2}]$, we obtain $$\int_{x_1}^{x_2}f(t)\,dt\leq (x_2-x_1)f(\mu)$$ that is $$\frac1{x_2-x_1}\int_{x_1}^{x_2}f(t)\,dt\leq f\left(\frac{x_2+x_1}2\right).$$