Proof $f$ has a minimum if $f$ is continuous and $\lim_{x \rightarrow \infty}(f(x))=\infty=\lim_{x \rightarrow -\infty}(f(x))$ I have a question about the validity of this proof I wrote:
Claim: If $f$ is continuous on $\mathbb{R}$ and $\lim_{x \rightarrow \infty}(f(x))=\infty=\lim_{x \rightarrow -\infty}(f(x))$, then $f$ has a minimum.
My proof:
Lower Bound Theorem) If $g$ is continuous on $[a,b]$, then $\exists z \in [a,b]: \forall x \in [a,b]: f(z)\leq f(x)$
(1) $\forall N_1: \exists n_1&gt;0: \text{if } x&gt;n_1 \text{ then } f(x)&gt;N_1$ (Definition)
(2) $\forall N_2: \exists n_2&lt;0: \text{if } x&lt;n_2 \text{ then } f(x)&gt;N_2$ (Definition)
(3) Given $N_1, N_2$: Let $I = [n_2, n_1]$
(4) $\therefore f$ is continuous on $I$
(5) $\therefore \exists y \in I: \forall x \in I:f(y) \leq f(x)$ (Using Lower Bound Theorem)
(6) If $x \in \mathbb{R}$ but $x \notin I$, then $x &lt; n_2$ or $x&gt;n_1$.
(7) $\therefore f(x) &gt; N_1$ or $f(x) &gt; N_2$
(8) Choose $N_1, N_2: f(y)&lt;N_1$ and $f(y)&lt;N_2$
(9) $\therefore \forall x \in \mathbb{R}:f(y) \leq f(x)$
Thanks for reading. I'm not sure about line 8. I already defined $N_1$ and $N_2$ in line 3, and constructed $y$ based on that in line 5. So if I redefine $N_1$ and $N_2$ based on $y$ in line 8, that could potentially redefine $y$ in line 5, which could redefine $N_1$ and $N_2$ in line 8, which could redefine $y$ in line 5, etc. etc. I'm pretty sure either this is just a little technicality that can be fixed easily but I'm not sure how, or it's not a problem at all and I'm overthinking. Can someone help?
As an alternative, let consider the restriction $f:[a,\infty) \to \mathbb R$ then if $f(a)$ is not a minimum for the restriction by IVT $\exists b&gt;a$ such that $f(b)=f(a)$ and $f(x)\ge f(b) \,\forall x\ge b$, then by EVT the restriction attains a minimum $f(c)$ at $c\in [a,b]$.
We can use the same argument for the restriction $f:(-\infty,a] \to \mathbb R$ to show that the restriction attains a minimum $f(c')$ at $c'\in [b',a]$.
Then $$\min (f(x))=\min(f(c),f'(c))$$
Let $x_0$ be some point in $\mathbb{R}$. Since $\lim_{x\to\pm\infty} f(x)=\infty$ and $f$ is  continuous, there exists an $M&gt;0$ such that $$f(x_1)&gt;f(x_0)$$ for any $x$ satisfying $|x|&gt;M$. Since any minimizer $x^*$ of $f$ over $\mathbb{R}$ satisfies $f(x^*)\leq f(x_0)$, it follows that the set of minimizers of $f$ over $\mathbb{R}$ is the same as the set over $\mathbb{R}\cap B_{|\cdot|}[0,M]$, which is compact and non-empty. This is because both $\mathbb{R}, B_{|\cdot|}[0,M]$ are closed and $B$ is bounded and contains $x_0$. Therefore by Weierstrass Theorem for closed functions, there exists a minimizer of $f$ over $\mathbb{R}\cap B_{|\cdot|}[0,M]$ and hence also over $\mathbb{R}$.
P.S.
The above holds for every coercive function $f$ and closed non-empty set $S$.