TITLE: help Extreme Value Theorem proof step
QUESTION [0 upvotes]: I'm trying to understand a proof for the extreme value theorem: Let $f$ be a continuous real-valued function on a closed interval [a, b].
Then $f$ is a bounded function. Moreover, $f$ assumes its maximum
and minimum values on [a, b]; that is, there exist $x_0$, $y_0$ in [a, b] such that $f(x0) ≤ f(x) ≤ f(y0)$ for all $x ∈ [a, b]$. 
I understand how to prove that $f$ is bounded, but now I'm trying to understand a proof of showing $f$ assumes its maximum and minimum values. To prove it, let $M = \text{sup}\{f(x):x\in[a,b]\}$ which we know exists because $f$ is bounded. Now, for all $n \in \mathbb{N}$, there exists a sequence $(y_n)$ such that $M - 1/n < f(y_n) \leq M$. Then the limit of $f(y_n) = M$, (but how can I prove this is the limit?) Then, by the Bolzano-Weiersrtass theorem, we can find a subsequence $(f(y_{nk}))$ with limit $y_0 \in [a,b]$. Then since $f$ is continuous, we know that lim$f(y_{nk})=f(y_0)$. Since $(f(y_n))$ is convergent, it has the same limit as its subsequence $(f(y_{nk}))$, $M$. Therefore, lim$f(y_n) = f(y_0) = M$, which is the maximum value and shows that the function assumes its maximum. My only question is how do we know that $(f(y_n))$ converges?

REPLY [1 votes]: You know it converges because of the squeeze theorem.
For each $n \in \mathbb{N}$, $M-1/n < f(y_n) ≤ M$. Hence by the squeeze theorem,
\begin{align*}
M = \lim_{n\rightarrow\infty}M-\frac{1}{n} \leq \lim_{n\rightarrow\infty}f(y_n) ≤ \lim_{n\rightarrow\infty}M = M
\end{align*}
Therefore $\lim_{n\rightarrow\infty}f(y_n)$ must exist and is equal to $M$
{"set_name": "stack_exchange", "score": 0, "question_id": 2201939}