Extended version of the boundedness theorem: $f$ attains its bounds $\inf$ and $\sup$ of $\{f(x) | x \in [a,b]\}$ I've been reading an extended version of the boundedness theorem, that also states that if $f$ is bounded, then it attains it bounds, and I've marked the step in the proof that I seem to not understand:
http://www-history.mcs.st-and.ac.uk/~john/analysis/Lectures/L21.html
The proof as linked to:
Let $f$ be defined and continuous at every point in $[a,b]$. Then $f$ is bounded, and to show $f$ attains it bounds, we must show there exists points $\alpha, \beta \in [a,b]$ such that $f(\alpha) = \inf f$ and $f(\beta) = \sup f$. Let $M = \sup \{f(x) | x \in [a,b]\}$. Construct a sequence $\{x_n\}$ like this: for each $n \in \mathbb N$ let $x_n$ be a point such that $f(x_n) =M -\frac 1 n$. Such a point must exists, otherwise $M -\frac 1 n$ is an upper bound smaller than $M$. By Bolzman-Weierstrass some subsequence of $\{x_n\}$, say $(x_{n_k})$ converge to say $\beta$ and $(f(x_{n_1}), f(x_{n_2}), ...) \rightarrow M$ by construction. By continuity of $f$ we have $f(\beta) = M$ as required.   
Question:
Why can we conclude that $f(\delta) = \beta$ ? The only thing we know is that some subsequence of $\{x_n\}$ converge, and that $f(x_1), f(x_2), ..$ converge. Does this allow us to write $\lim_{n \rightarrow \infty} \{f(x_n)\} = f(\lim_{n \rightarrow \infty} x_n) = f(\delta) = \beta$? If yes, why ?
In general if we know $\{f_n\}$ converge, we cannot be sure $\{x_n\}$ converge. What if $x_n = -1^n$ and $f(x) = k$ a constant function ? 
 A: It's called the Sequential Criterion for the continuity of real-valued functions. 
It's one of the equivalent definitions of continuity on the real line.
$\mathbf{Theorem}$
(Sequential Criterion for Continuity) Let $A\subseteq \mathbb{R}$. Given a function $f : A \to \mathbb{R}$
and a limit point $c\in A$ of $A$, the following are equivalent:


*

*$f$ is continuous at $c$.

*$$ \lim_{x \to c} f(x) = f(c)$$

*For all sequences $(x_n) \subseteq A$ with $lim_{n \to \infty}x_n=c$,
$$\lim_{n \to \infty} f(x_n) =f(c)$$
Focus on the third definition - you can try to prove this!
A: This is one of the equivalent definitions of continuity for real functions. You might be used to thinking that a function $f: [a,b]\to\mathbb{R}$ is continuous if and only if $f(x_0) = \lim_{x\to x_0}f(x)$ for all $x_0 \in [a,b]$ (where the limit is one-sided if $x_0 = a$ or $b$) or an equivalent "$\epsilon$, $\delta$-formulation" of this statement. It turns out that $f$ as above is continuous if and only if $x_n \to x \implies f(x_n) \to f(x)$ whenever $x,x_1,x_2,\ldots \in [a,b]$. In fact, many people take this to be the definition of continuity. (Try to prove this!)
