# Convex function which has a limit in $-\infty$ is non decreasing

I have a homework question, looks simple but I can't figure out a way to solve it. Any clue or help will be helpful.

Let $f: \mathbb R\rightarrow\mathbb R$ be a convex function such that $\lim_{x\rightarrow-\infty}f(x)=5$.

Show that $f$ is non decreasing.

Thanks a lot!

suppose $\exists x<y$ such that $f(x)>f(y)$, then $\forall z<x$ - by convexity - $$\frac{(f(z)-f(y))(x-y)}{z-y}+f(y)\ge f(x)$$ or $$f(z)\ge \frac{(f(x)-f(y))}{x-y}(z-y)+f(y)$$ where the factor $\frac{f(x)-f(y)}{x-y}$ is negative by assumption. as $z\rightarrow-\infty$, the right hand side grows without bound. this contradicts the limit assumption (it doesn't matter what numeric value the limit attains, only that it's finite)

Note that $f:\Bbb R\to\Bbb R$ is convex if and only if for all $x$ we have $$\frac{f(x_1)-f(x)}{x_1-x}\le\frac{f(x_2)-f(x)}{x_2-x}$$ whenever $x_1<x_2$ with $x_1,x_2\neq x$.

Suppose $x_1<x_2$ are such that $f(x_1)>f(x_2)$. For any $x<x_1$, we have $$\frac{f(x_1)-f(x)}{x_1-x}\le\frac{f(x_2)-f(x)}{x_2-x}\\\bigl(f(x_1)-f(x)\bigr)(x_2-x)\le\bigl(f(x_2)-f(x)\bigr)(x_1-x)\\f(x_1)x_2-f(x_1)x-f(x)x_2+f(x)x\le f(x_2)x_1-f(x_2)x-f(x)x_1+f(x)x\\f(x_1)x_2-f(x_1)x-f(x)x_2\le f(x_2)x_1-f(x_2)x-f(x)x_1\\\bigl(f(x_2)-f(x_1)\bigr)x\le f(x_2)x_1-f(x_1)x_2+f(x)(x_2-x_1)$$ Now consider the limit of that last inequality as $x\to-\infty$ to get a contradiction, completing the proof.