Prove: $f: (a,b) \rightarrow \mathbb{R}$ is convex iff for every triple $x_1,x,x_2 \in (a,b)$... 
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.


If $f$ is convex: then $\dfrac{f(x) - f(x_1)}{x - x_1} \leq \dfrac{f(x_2) - f(x)}{x_2 - x} \tag 1$ is equivalent to: $(x_2 - x_1)f(x) \leq (x - x_1)f(x_2) + (x_2 - x)f(x_1)$ which in turn is equivalent to $f(x_1\cdot \dfrac{x_2 - x}{x_2 - x_1} + x_2\cdot \dfrac{x - x_1}{x_2 - x_1}) \leq f(x_1)\cdot \dfrac{x_2 - x}{x_2 - x_1} + f(x_2)\cdot \dfrac{x - x_1}{x_2 - x_1}$ which is true since $f$ is convex.
Conversely if the above inequality is true, we show $f$ is convex. This means we need to show the following:
For any $x_1, x_2 \in (a, b)$ and $x_1 < x_2$, and for any $t \in [0, 1]$ we have:
$f(tx_1 + (1-t)x_2) \leq tf(x_1) + (1-t)f(x_2) \tag 2$. The inequality is true for $t = 0$ or $t = 1$. Let $t \in (0, 1)$, then we can find an $x \in (x_1, x_2)$ such that $t = \dfrac{x_2 - x}{x_2 - x_1}$. Plug this value of $t$ into $(2)$ and observe that the new inequality is equivalent to $(1)$ and we're done.
