problem about continuity and limits Let $f\colon\mathbb R \to \mathbb R$ be a continuous function.
Suppose that $\lim_{x \to +\infty} f(x) = \lim_{x \to -\infty} f(x) = +\infty$. 
Prove that $f$ has a minimum, i.e., $\exists x_0 \in \mathbb R: \forall x \in \mathbb R f(x) \geq f(x_0)$:
My solution:
Suppose $\exists x_0 \in \mathbb R:\forall x \in\mathbb R: f(x) \geq f(x_0)$ is false. Then, $\forall x_0 \in \mathbb R: \exists x\in\mathbb R: f(x) < f(x_0)$ (1).
$\lim_{x \to +\infty} f(x) = +\infty \implies \forall \varepsilon >0: \exists M>0: x>M \implies f(x) > \varepsilon$.
In particular, for $\varepsilon=f(x_0)$, we have $f(x)>f(x_0)$, which is an absurd, because it contradicts the hypothesis (1).
Therefore $\exists x_0 \in \mathbb R: \forall x\in\mathbb R:f(x) \geq f(x_0)$
I´d like to hear from you if my solution is correct or not.
 A: $f$ is continuous and $\lim_{x\to \infty}f(x)=\lim_{x\to-\infty}f(x)=\infty$, choose an arbitray $y_0\in \mathbb{R}$  so there is 
a $M_1$ such that if  $x>M_1$ then $f(x)>f(y_0)$ and a $M_2>0$ such that if $x<-M_2$ then
$f(x)>f(y_0)$, . Now, observe that
$[-M_2,M_1]$ is compact, and $f$ is continuous, therefore it has a maximum and a minimum in this set. And the minimum $x_0 \in [-M_2,M_1] $ is global because if  $ x\in [-M_2,M_1] $ then $  f(x)\geq f(x_0)$ and  because   our choose we have that
$y_0\in[-M_2,M_1]$ then $f(x_0)\leq f(y_0)$. Now 
if $x \in  \mathbb{R} - [-M_2,M_1] $ then $f(x)> f(y_0)\geq f(x_0)$. And you have a global minimum.
An observation in your answer is that: Say that the negative of the statement: $f$ has a minimum is $f$ does not have a minimum. What you are doing is electing an element and showing that it is not a maximum because you find an $x$ such that $f(x)>f(x_0)$, and it does not solve the problem, do you see?
A: Here's how I would proceed:  pick any $x_0 \in R$; if, for all $x \in R$ we have $f(x) \ge f(x_0)$, we are clearly done:  $x_0$ is a requisite minimum.  On the other hand, if there exists $x \in R$ with $f(x) < f(x_0)$, then the set $S$ of all such $x$, $S = \{x \in R, f(x) < f(x_0)\}$, is clearly non-empty.  Now since $f(x) \to \infty$ as $x \to \pm \infty$, there exists $M \in R$ with $f(x) > f(x_0)$ outside of the closed interval $[-M, M]$; this is an immediate and easy consequence of the definition of the phrase $f(x) \to \infty$ as $x \to \pm \infty$.  Restricting $f$ to the compact interval $[-M, M]$, we can invoke the standard result that a continuous function on a compact set attains its maximum and minimum on that set.  Thus there must be $y \in [-M, M]$ with $f(y) \le f(x)$ for any $x \in [-M, M]$.  But outside of $[-M, M]$, $f(x) > f(x_0)$, thus $S \subseteq [-M, M]$, and $y \in S$ must in fact be a global minimum for $f$.
I hope this is clear; my introduction and use of $S$ may be a little awkward, but I don't have time to polish this answer now.
