Prove that the following inequalities are equivalent.


Prove that

If ‎$ ‎‎f:(0,+‎\infty‎)\to‎\mathbb{R}‎$ ‎be a‎ ‎‎continuous ‎function, then the following are equivalent (for every $ x\in(0,+‎\infty‎)$ ).

(1)‎$ ‎‎‎‎‎\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) ‎$ ‎\frac{1}{2}(f(x_2)+f(x_1))‎\leq‎‎‎\frac{1}{x_2-x_1}\int_{x_1}^{x_2}f(u)du‎‎\leq‎ f(‎\frac{x_2+x_1}{2}‎)‎‎.$

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(‎\frac{x_2+x_1}{2}‎)$ . Moreover I know that the condition (2) along with continuity imply that $ f$ is a convex 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.