(1).... Let $J=[a,b]$ with $a\leq b.$ Any sequence $(x_n)_{n\in N}$ of members of $J$ has a convergent subsequence. That is, there is a strictly increasing $g:N\to N$ such that $(x_{g(n)})_{n\in N}$ is a convergent sequence.
Proof: Let $J_1=[a,(a+b)/2]$ if $\{n: x_n\in [a,(a+b)/2]\}$ is an infinite set, otherwise let $J_1=[(a+b)/2,b].$ Recursively,when $J_n=[a_n,b_n],$ let $J_{n+1}=[a_n,(a_n+b_n)/2]$ if $\{n:x_n\in [a_n,(a_n+b_n)/2\}$ is infinite, otherwise let $J_{n+1}=[(a_n+b_n)/2,b_n].$
Now for every $n\in N$ the set $\{n:x_n\in J_n\}$ is infinite, and $J_{n+1}\subset J_n,$ and $b_n-a_n=2^{1-n}(b-a).$
Let $g(1)$ be the least (or any) $m$ such that $x_m\in J_1.$ Recursively, let $g(n+1)$ be the least (or any) $m$ such that $m>g(n)$ and $x_m\in J_{n+1}.$
Then $(x_{g(n)})_{n\in N}$ is a Cauchy sequence because $J_{n+1}\subset J_n\implies \{x_{g(n+1)},x_{g(n)}\}\subset J_n$ $\implies |x_{g(n+1)}-x_{g(n)}|\leq b_n-a_n=2^{1-n}(b-a)$ (which is sufficient to imply the Cauchy condition ). Of course a Cauchy sequence in $[a,b]$ converges to a member of $[a,b].$
(2).... A continuous $f:[a,b]\to R$ is bounded. Proof: (By contradiction).If not, let $x_n\in [a,b]$ with $|f(x_n)|>n$. By (1),let $(x_{g(n)})_{n\in N}$ be a convergent subsequence of $(x_n)_{n\in N}$ with limit point $x\in [a,b].$ Continuity of $f$ requires that $f(x_{g(n)})\to f(x)$ as $n\to \infty.$ But $|f(x_{g(n})|>|g(n)|=g(n)\geq n,$ so $(f(x_{g(n)})_{n\in N}$ is not a convergent sequence, a contradiction.
(3).... A continuous $f :[a,b]\to R$ attains it maximum and minimum. Proof: By (2), $M=\sup \{f(x):x\in [a,b]\}<\infty.$ Let $x_n\in [a,b]$ with $M\geq f(x_n)\geq M-2^{-n}.$ By (1) let $(x_{g(n)})_{n\in N}$ be convergent to $x^*\in [a,b].$ Continuity of $f$ implies $f(x^*)=\lim_{n\to \infty}f(x_{g(n)})=M.$ Obtaining $y^*\in [a,b]$ with $f(y^*)=m=\inf \{f(x):x\in [a,b]\}$ is done similarly.
(4)...By IVT, with $x^*$ and $y^*$ as in (3) we have $$\{f(x):x\in [a,b]\}\supset [f(y^*),f(x^*)]=[m,M].$$ By def'n of $ m$ and $M$ we have $$\{f(x):x\in [a,b]\}\subset [m,M].$$