Assignment: Prove that a function $f : (a,b) \rightarrow \mathbb{R}$ is convex if and only if for every triple $x_1,x,x_2 \in (a,b)$ with $x_1 < x < x_2$ following inequality is satisfied: $$\frac{f(x)-f(x_1)}{x-x_1} ≤ \frac{f(x_2)-f(x)}{x_2-x}$$
Both sides of the inequality are difference quotients but I don't know where to go from here. Any help would be appreciated.
Edit:
A solution of mine for $\leftarrow$ of the proof.
Since $x \in (x_1, x_2)$ I can define $x:= (1-t)x_1+ tx_2$ for $0<t<1$. I can rearrange the inequality such that: > $0≤ (x_t - x_1)(f(x_2)-f(x_t))-(x_0-x_t)(f(x_t)-f(x_1)) = (x_2-x_1)[(1-t)f(x_1)+tf(x_2)-f(x_t)]$
and since $x_2-x_1 > 0 $ i can $(1-t)f(x_1)+tf(x_2)-f(x_t) > 0$ which means that $f$ is convex.
For convex functions, it's really useful to visualize what you have to prove on a drawing. If you can understand the following picture:
Then your result will be obvious.