We define a continuous extension of $f(x)$ to the set $[a,b]$, by $g(x)=f(x), x\in (a,b)$ and $g(a)= \lim_{x \to a^{+}}f(x)$ and $g(b)=\lim_{x \to b^{-}}f(x)$. $g(x)$ being continuous on a compact set in $\mathbb{R}$, it is bounded. So, $f$ being a restriction of $g$, it must also be bounded.
Is this correct?