I would need a check on the following exercise:
Let $f:\mathbb{R} \rightarrow \mathbb{R}$ a convex function.
Prove that $\lim_{x \rightarrow \infty} f(x)$ and $\lim_{x \rightarrow - \infty} f(x)$ exist
Show that if both the limits are finite, then $f$ is constant.
My attempt:
i ) I know that if $f$ is convex, then $$f(t x_1 + (1-t)x_2)< t f(x_1) + (1-t) f(x_2)$$
If I fix an arbitrary $N>0$, then I have that for $x>x_2 \colon \quad f(x)>N$, thanks to the convexity, therefore this proves the limit to $+ \infty$ is $+\infty$.
The same argument applies to $\lim_{x \rightarrow -\infty}f(x)$: it suffices to note that for $x<x_1 \colon \quad f(x)>N$.
ii)
Graphically it's obvious, but I have some problem in make it formal.
If the limit is finite, say $L$, then for every $\varepsilon >0$ there exists an $M(\varepsilon)$ such that for $$x>M(\varepsilon) \colon \quad |f(x)-L|\leq \varepsilon$$
Assume $f (x) \ne c$. By definition of convexity, it has to hold (for $t \in [0,1]$) $$t f(M)+(1-t)f(M+1) \leq f(t M + (1-t)(M+1))$$
Now, by definition of limit, $f(M)$ and $f(M+1)$ are less than $L-\varepsilon$. Also, the argument in the rhs of the inequality can be simplified:
$$L-\varepsilon <t f(M)+(1-t)f(M+1) \leq f(t M + (1-t)(M+1)) = f(M-t)$$
Therefore $$L-\varepsilon < f(M-t)$$, which is a contradiction because $M-t<M$ and hence it can be greater than $L-\varepsilon$.
So $f$ has to be equal to $c$. Indeed in this case, it is still (trivially) convex, and the limits are of course finite.
Hint : try to prove that a convex function is either decreasing, either increasing, either decreasing then increasing.