How to prove this property of the convex functions?

I'm trying to solve this problem.

Let $$f$$ be a convex function such that $$f: \mathbb R\rightarrow \mathbb R.$$ Prove that $$\lim_{x\rightarrow +{\infty}}f(x)$$ and $$\lim_{x\rightarrow -{\infty}} f(x)$$ always exists. If those limits are both finite, it is true that $$f$$ is a constant function?

Thank you for the help!

• If it ever increases, ask the question: is it allowed to decrease again? – Michael May 31 at 19:55

Since $$f$$ is convex, given $$s < t < u$$, we have $$\frac{f(t) - f(s)}{t - s} \le \frac{f(u) - f(s)}{u - s} \le \frac{f(u) - f(t)}{u - t}$$

If $$f$$ is constant, the limits exist.

If not, suppose $$f(s) < f(t)$$. Letting $$u \rightarrow + \infty$$ in the first inequality, we get $$\lim_{x \rightarrow +\infty} f(x) = +\infty$$. Now, suppose $$f(t) > f(u)$$. Letting $$s \rightarrow - \infty$$ in the second inequality, we get $$\lim_{x \rightarrow -\infty} f(x) = +\infty$$.

Now, assume both limits exist and are finite. Letting $$u \rightarrow + \infty$$ in the first inequality, we get $$f(t) \le f(s)$$ and letting $$s \rightarrow - \infty$$ in the second inequality, we get $$f(t) \le f(u)$$. So $$f$$ is both non-increasing and non-decreasing, i.e., constant.

For the first part, specifically, $$\limsup_{x\rightarrow\infty} f(x)=\liminf_{x\rightarrow\infty}f(x)$$.

To see this, let $$s_n$$ be the sequence of $$x$$ that achieves the sup and $$m_n$$ be the one for inf. Then

$$f(tm_n+(1-t)m_{n+1})\leq tf(m_n)+(1-t)f(m_{n+1}).$$

As both $$m_n,s_n$$ go to infinity, you can always find a subsequence $$s_{n_k}$$ which interlaces between infinitely many $$m_{n_k},m_{n_{k+1}}$$. It follows that $$f(s_{n_k})\leq t_{n_k}f(m_{n_k})+(1-t_{n_k})f(m_{n_{k+1}})$$. Take the limsup of both sides to conclude that $$\limsup_{x\rightarrow\infty}f(x)\leq\liminf_{x\rightarrow\infty}f(x)$$.