Tricky detail in extreme value theorem proof I am reading Pugh's Real Mathematical Analysis, and in chapter 1, section 6, ``The Skeleton of Calculus,'' Pugh supplies a proof of the Extreme Value Theorem. I am having trouble understanding one particular point in the proof. Note that he proves the existence of maximums, and leaves minimums for the reader.
Theorem 23. A continuous function $f$ defined on an interval $[a, b]$ takes on absolute minimum and absolute maximum values: for some $x_0, x_1 \in [a,b]$ and for all $x \in [a,b]$,
$f(x_0) \leq f(x) \leq f(x_1)$.
Proof. Let $M = \sup f(t)$ as $t$ varies in $[a,b]$. This exists since the values of a continuous function defined on an interval $[a,b]$ form a bounded subset of $\mathbb R$ (his Theorem 22). Consider the set $X = \{x \in [a,b] : \sup V_x < M\}$ where $V_x$ is the set of values of $f(t)$ as $t$ varies on $[a,x]$.
Case 1: $f(a) = M$. Then $f$ takes on a maximum at $a$ and the theorem is proved.
Case 2: $f(a) < M$. Then $X$ is nonempty and we can consider the supremum of $X$, say $c$. Here's where I lose him---I don't seem to understand what's going on here. If $f(c) < M$, we choose $\epsilon > 0$ with $\epsilon < M - f(c)$. By continuity, there exists a $\delta > 0$ such that $|t - c| < \delta \implies |f(t) - f(c)| < \epsilon$. I understand the use of continuity and the application of the definition of a continuous function, but I don't understand the motivation for considering the continuity of $f$ at $c$. Thus, $\sup V_c < M$. I don't understand how we can deduce that $\sup V_c < M$ by considering the continuity of $f$ at $c$.
If you could help me understand this proof, and specifically how considering the continuity of $f$ at $c$ helps us determine that $\sup V_c < M$, I would greatly appreciate it.
 A: My guess: the idea is to prove that $f(c)=M$. He proves it by contradiction. Assume that $f(c)<M$ then by continuity we can go a bit further to $c+\delta$ and still have all functional values being under $M$. It contradicts the choice of $c$ as the supremum of $X$.
P.S. It is easy, but you have to mention also that $c\in[a,b]$.
A: As usual from what I have seen of Pugh's book, his proof is not very clear.
I assume Case 1 is understood, so assume Case 2 holds.
Note that if $x \in X$, then every number $y \in [a,x]$ is also in $X$ (in other words, $x \in X \iff [a,x] \subset X$). This is because the supremum cannot increase if we compute it over a smaller set: $\sup\{f(t) : t \in [a,y]\} \leq \sup\{f(t) : t \in [a,x]\} < M$. We will use this handy fact below.
Recall that $c$ has been defined as $\sup X$, which exists because $X$ is nonempty in Case 2, and because $X$ is bounded above by $b$.
Choose an arbitrary $\gamma \in (0,c-a]$. By definition of the supremum of $X$, there is an element $x \in X$ with $x > c - \gamma$. By the handy fact, this means that $[a,c - \gamma]\subset [a,x] \subset X$. Since this is true for arbitrarily small positive $\gamma$, it follows that $[a,c) \subset X$.
The goal is to show that $f(c) = M$. Note that since $f(x) < M$ for all $x \in (a,c)$, and $f$ is continuous, the only way that this can be false is if $f(c) < M$.
So, suppose for a contradiction that $f(c) < M$.  Then there is some $\epsilon > 0$ such that $f(c) < f(c) + \epsilon < M$. So, $f(c) < M - \epsilon$.
Now, since $f$ is continuous, it can't instantly "jump" above $M$ as soon as $x > c$. In other words, we will also have $f(x) < M$ in some neighborhood around $c$.
Expressing this more formally, there is some $\delta > 0$ such that $f(t) < M - \epsilon/2 < M$ whenever $t \in (c-\delta, c + \delta)$. Therefore, the supremum of $f$ on $(c-\delta , c + \delta)$ does not exceed $M - \epsilon/2$. But the supremum of $f$ on $[a,c-\delta]$ is also strictly smaller than $M$. Therefore, the supremum of $f$ on the entire interval $[a,c+\delta) = [a, c-\delta] \cup (c-\delta, c+\delta)$ is strictly smaller than $M$. Consequently, by the handy fact above, every number less than $c + \delta$ is in $X$. But this contradicts $\sup X = c$.
So, our assumption that $f(c) < M$ is false, and consequently we must have $f(c)= M$.
A: The idea is simple. If $f(c) < M$ then by continuity we have an interval around $c$ where the values of $f$ are less than $M$. In fact a stronger statement is true and that is what we need. We can find an interval of $[c - h, c + h]$ such that all values of $f$ are less than a specific number $M'$ which is itself less than $M$.
Next it should be easy to see that $c - h < c$ and $c - h \in X$ (why??). and therefore supremum of $f$ on $[a, c - h]$ is less than $M$, say equal to $M''$ and $M'' < M$. Now the values of $f$ in $[c - h, c + h]$ are less than $M'$ so it follows that supremum of $f$ on $[a, c + h]$ does not exceed $\max(M', M'')$. And hence the supremum of $f$ on $[a, c + h]$ is also less than $M$ and $c + h \in X$. This is not possible as $c = \sup X$.
A much better proof is to use theorem $22$ of your book. Assume $f(x) \neq M$ for all $x \in [a, b]$. Then $g(x) = 1/(M - f(x))$ is continuous on $[a, b]$ and hence by theorem $22$ it is bounded on $[a, b]$. Now $M = \sup f(x)$ and hence given any $\epsilon > 0$ there is an $x$ such that $M - f(x) < \epsilon$ so that $g(x) > 1/\epsilon$. This shows that $g(x)$ is unbounded. This contradiction shows that we must have $f(x) = M$ for some $x \in [a, b]$.

BTW the proof in your question uses "supremum principle" (every non-empty set with upper bound has a supremum). You should try to devise other proofs based on principles like Nested Interval Principle and Heine Borel Theorem.
A: There are two things going on: compactness/Bolzano-Weierstrass, and continuity.
If $X=[a,b]$ is closed and bounded, it is compact by the Heine-Borel theorem.
Take $M = \sup_{x \in X=[a,b]}f(x)$. Now consider any sequence $x_n$ in $X=[a,b]$ satisfying
$$
M- \dfrac{1}{n} \le f(x_n) \le M.
$$
(Note that because $M$ is the supremum of $f(x)$ over $X$, there cannot be any $f(x_n)>M$.)
Now because $X=[a,b]$ is compact, the Bolzano-Weierstrass theorem implies it has a convergent subsequence $x_{n_k} \rightarrow x^*$. Consider
$$
M - \dfrac{1}{n_k} \le f(x_{n_k}) \le M.
$$
If we take the limit, 
$$
\lim_{n_k \rightarrow \infty} M - \dfrac{1}{n_k} \le \lim_{n_k \rightarrow \infty} f(x_{n_k}) \le M,
$$
by the sequential criterion for continuity $\lim_{x_n \rightarrow x^*}f(x_n)=f(x)$, so that
$$
M \le  f(\lim_{n_k \rightarrow \infty} x_{n_k}) \le M,
$$
or 
$$
M \le  f(x^*) \le M,
$$
This implies $x^* \in X = [a,b]$ is a maximizer of $f$, since it achieves the supremum.
Note that none of this really has to do with $X=[a,b]$: the real ingredients of the proof are the definition of the sup, compactness, and the sequential criterion for continuity.
