So, the theorem I'm trying to prove is the following:
If $f$ is continuous on $[a,b]$, then $f$ is bounded on $[a,b]$.
Proof Attempt:
Let $f$ be continuous on $[a,b]$. Suppose that $f$ is not bounded on $[a,b]$. So, there does not exist an $M > 0$ such that:
$$|f(x)| \leq M$$
for any $x \in [a,b]$. Define a sequence $\{x_n\}$ such that all the terms of the sequence belong to $[a,b]$. Then, it is clear that there does not exist an $n \in \mathbb{N}$ such that:
$$|f(x_n)| \leq n$$
By a previously proven result, there exists a $c \in [a,b]$ such that every neighbourhood of $c$ contains infinitely many terms of the sequence. So, the function is unbounded in every neighbourhood of $c$. By another previously proven result, it follows that $\lim_{x \to c} f(x)$ does not exist. This contradicts the continuity of $f$ as asserted by the hypothesis. It follows that $f$ must be bounded on $[a,b]$. This proves the desired result.
Does the proof above work? If it doesn't, why? How can I fix it?
Why is it “clear that there does not exist an $n\in\Bbb N$ such that $|f(x_n)|\leqslant n$”? Besides, what does this mean? Is it for every $n$ or for some $n$?
Suppose that $f$ is unbounded. For each $n\in\Bbb N$, take $x_n\in[a,b]$ such that $\bigl|f(x_n)\bigr|\geqslant n$; such a $x_n$ must exist, since we are assuming that $f$ is unbounded. This sequence has a subsequence $(x_{n_k})_{k\in\Bbb N}$ that converges to some $c\in[a,b]$. Therefore, $\lim_{k\to\infty}f(x_{n_k})=f(c)$. But this is impossible, since every subsequence of $\bigl(f(x_n)\bigr)_{n\in\Bbb N}$ is unbounded and every convergent sequence is bounded.