Suppose that the common limit is the real number $c$. Move $f$ up or down so that the limit is $0$. Call the resulting function $g$.
If $g$ is $0$ everywhere, we are finished. Otherwise, $g$ is either somewhere positive, or somewhere negative, or both.
Suppose first that $g$ is positive somewhere. Then for some $a$, and some positive $\epsilon$, we have $g(a)=\epsilon$.
There exists a real number $R$ such that $|g(x)|<\epsilon$ if $|x|>R$. On the interval $[-R, R]$, the function $g$ attains a maximum value. That value is at least $\epsilon$, so it is greater than $g(x)$ for any $x$ such that $|x| >R$. It follows that $g$ attains a global maximum.
If $g$ is somewhere negative, a mild modification of the above argument shows that $g$ attains a global minimum. Alternately, we can consider the function $-g$.
The result also holds if the limits are the same in the extended sense, for example if both limits are $+\infty$. Pick any real $a$, and let $f(a)=b$. There is an $R$ such that $f(x)>b$ if $|x|>R$. On the interval $[-R, R]$, the function $f$ attains a minimum value. That minimum value is $\le b$. Since $f(x)>b$ for $|x|>R$, that minimum value is a global minimum value.