Proving existence of a minimum If $f:\mathbb{R}\to\mathbb{R}$ is continuous and $$\lim_{x\to\infty}f(x)=\lim_{x\to-\infty}f(x)=\infty$$ 
Prove that $f$ has a minimum on $\mathbb{R}$; that is, there is an $x_m\in\mathbb{R}$ such that $$f(x_m)=\inf_{x\in\mathbb{R}}f(x)<\infty$$
I think the best approach would be to prove the existence of a lower bound, that is $\exists M\in\mathbb{R}:M<f(x),\forall x\in\mathbb{R}$, but I don't know how to do this.
I am probably supposed to use the extreme value theorem or the intermediate value theorem, but I don't know how to do that.
 A: It is simple if you note the obvious fact that value of the function $f$ is always a real number although its limit may be $\pm\infty$. Let's for specificity set $A = f(0)$. Since $f(x) \to \infty$ when $x \to \infty$ or $x \to -\infty$, it follows that there exists a real number $M > 0$ such that $f(x) > |A|$ for $x \geq M$ and $x \leq -M$. Consider the function $f$ on interval $[-M, M]$. Since it is continuous it has a minimum value on this interval. And clearly one of the values of $f$ in this interval is $A = f(0)$. Since $f(M)$ and $f(-M)$ are greater than $|A|$ it follows that the minimum value is attained at an interior point $c \in (-M, M)$. Further note that beyond the interval $[-M, M]$ the values of $f$ are greater than $|A|$ and hence these values are also greater than $f(c)$. It follows that $f(c)$ is the minimum value of $f$ on whole of $\mathbb{R}$.
A: Hint:
For any $a\in \mathbf R$, $K=f^{-1}\bigl((-\infty,f(a)]\bigr)$ is closed, and since $\lim\limits_{x\to\pm\infty}f(x)=+\infty$, it is bounded. By the extreme value theorem, on this compact set, $f$ attains a minimum $m\le f(a)$, which is a minimum on $\mathbf R$ by the very definition of $K$: indeed, if $x\in\mathbf R\smallsetminus K$, $f(x)>f(a)\ge m$.
