If $f: [a,b] \rightarrow \mathbb{R}$ is continuous then $f$ is bounded My attempt
Let $X=\{x \in [a,b]; f|[a,x]$ is bounded $\}$. 
We have $a\in X$ and $X \subset [a,b] \Rightarrow$  $X$ is non-empty and bounded. 
Therefore
there exists $c = \sup X \leq b$.
We have:
1) $c \in X$;
Indeed, take $\varepsilon = 1$, since $f$ is continuous at $c$, there
exists $\delta>0$ such that
$x \in (c-\delta, c + \delta) \cap [a,b] \Rightarrow |f(x)-f(c)| < 1$.
Since $c-\delta<c$, there exists $y\in X$ such that $c-\delta<y\leq c$.  Since $y \in X$ we have $f|[a,y]$ bounded.
$f|(y,c]$ is also bounded:
Let $x\in (y,c] \subset (c-\delta, c + \delta).$
Then  $|f(x)| \leq |f(x)-f(c)| + |f(c)|  < |f(c)| + 1$.
Therefore $f|(y,c]$ is bounded. 
Thus $f|[a,c]$ is bounded $\Rightarrow c \in X$.
2) $c=b$;
By contradiction, let's suppose that $c<b$.
Take $\varepsilon = 1$, since $f$ is continuous at $c$, there
exists $\delta>0$ such that
$x \in (c-\delta, c + \delta) \cap [a,b] \Rightarrow |f(x)-f(c)| < 1$.
Let $y \in (c, \min \{ c + \delta, b\})$. We have $y\in [a,b]$. 
$f|[a,c]$ is bounded since $c \in X$. 
$f|(c,y]$ is also bounded: 
Let $x \in (c, y] \subset  (c-\delta, c + \delta)
\cap [a,b]$.
Then $|f(x)| \leq |f(x)-f(c)| + |f(c)|  < |f(c)| + 1 $. Therefore
$f|(c,y]$ is bounded.
Thus $f|[a,y]$ is bounded$ \Rightarrow y\in X$. We have $y>c = \sup X$, which is a contradiction, 
Then $c=b$.
3) $X=[a,b]$.
Indeed, let $x \in [a,b]$. So $f([a,x]) \subset f([a,b])$. Since
 $f([a,b])$ is bounded  we have  $f|[a,b]$ bounded $\Rightarrow x \in X$.
Thus,  $X=[a,b]$.
Am I right?
 A: I don't see any problems with it on first glance. However, you should consider starting your proof by contradiction, like this: suppose $f$ is not bounded on $[a,b]$, then $\ldots$ 
If you then use Bolzano-Weierstrass, you'll get a much shorter (and more elegant) proof of the same result.
A: Yes, it seems correct. You're basically using the fact that a continuous function is “locally bounded”.
Here's how I might write it.
Lemma. For every $c\in[a,b]$, there exists $\delta>0$ such that $f$ is bounded on $(c-\delta,c+\delta)\cap[a,b]$.
Proof. By continuity of $f$ at $c$, there exists $\delta>0$ such that, for $x\in(c-\delta,c+\delta)\cap[a,b]$,
$$
|f(x)-f(c)|<1
$$
and therefore $f(c)-1<f(x)<f(c)+1$. QED
Consider the set $X=\{y\in[a,b]: f|_{[a,y]}\text{ is bounded}\}$. Then $a\in X$ and therefore $c=\sup X$ exists. Suppose $c<b$ and take $\delta>0$ such that $f$ is bounded on $(c-\delta,c+\delta)\cap[a,b]$.
By definition of supremum, there exists $y_1\in X$ with $c-\delta<y\le c$. Then $f$ is bounded on $[a,y_1]$, but also on $(c-\delta,c+\delta)$. Since $c<b$, there exists $y_2\in(c,c+\delta)$, $y_2<b$. But then $f$ is also bounded on $[y_1,y_2]$ and therefore it is bounded on $[a,y_2]$. So $y_2\in X$, a contradiction.
