TITLE: Extreme Value Theorem Proof (Spivak)
QUESTION [7 upvotes]: Them: If $f$ is continuous on $[a,b]$, then there is a $y$ in $[a,b]$ such that $f(y) \geq f(x)$ for each $x \in [a,b]$
Proof. We already know that $f$ is bounded on $[a,b]$, which means that the set $$\{ f(x):x\text{ in }[a,b]\}$$ is bounded. This set is obviously not $\varnothing$, so it has a least upper bound $\alpha$. Since $\alpha\geqslant f(x)$ for $x$ in $[a,b]$ it suffices to show that $\alpha=f(y)$ for some $y$ in $[a,b]$.
Suppose instead that $\alpha\neq f(y)$ for all $y$in $[a,b]$. Then the function $g$ defined by $$g(x)=\dfrac1{\alpha-f(x)},\quad x\text{ in }[a,b]$$ is continuous on $[a,b]$, since the denominator of the right side is never $0$. On the other hand, $\alpha$ is the least upper bound of $\{f(x):x\text{ in }[a,b]\}$; this means that $$\text{for every $\epsilon\gt0$ there is $x$ in $[a,b]$ with $\alpha-f(x)\lt\epsilon$}.$$ This, in turn, means that $$\text{for every $\epsilon\gt0$ there is $x$ in $[a,b]$ with $g(x)\gt1/\epsilon$}.$$ But this means that $g$ is not bounded on $[a,b]$, contradicting the previous theorem. $\Rule{0.3em}{0.87em}{0.1em}$

OKay first of all how on earth does one come up with $g(x)$? It just feels like it comes out of nowhere. On the other hand what does

This means that: for every $\epsilon > 0$, there is x in $[a,b]$ with $\alpha - f(x) < \epsilon$

even mean? This statement is true, I agree, but I have absolutely no feeling for it. I also do not understand the last line with $g$. He could have chosen $\epsilon  = \alpha - f(x)$ and be done it no?

REPLY [4 votes]: Where did $g$ come from?
The author needed a function that would be continuous on $[a, b]$ if $\alpha$ was not a value of $f(x), x\in[a, b]$.  Basically, he chose this function because it is easy to see that it becomes discontinuous only if the least upper bound for the set is also in the set.
He needed it to become discontinuous to provide the contradiction found in the last step.
What does that quoted statement mean?

$$\text{for every }\varepsilon > 0\text{, there is } x \in [a,b]\text{ with }\alpha−f(x)<\varepsilon$$

In non-math talk, this basically means that, if you pick as small an $\varepsilon$ as you want, then there is an $x$ value in the range such that $\alpha - f(x)$ is less that that value you picked.
Even further in non-math talk: Pick any small value, and the function gets closer to the least upper bound than the magnitude of that small value.
(I know this is somewhat late, but I drafted it before leaving for a meeting... I didn't want it to go to waste. ;))