Prove that function $f$ is bounded on $(a, b)$ 
Let $f$ be a continuous function on interval $(a, b)$ (finite or infinite), and assume that both $\lim_{x \to a^+} f(x)$ and $\lim_{x \to b^-} f(x)$ exist, and they are finite. Prove that $f$ is bounded on $(a, b)$.


I know that a function is continuous on interval $(a, b)$ if $\forall x_0\in(a,b), \lim_{x\to x_0}f(x)=f(x_0)$ and if $$\lim_{x\to a^+}f(x)=f(a), \qquad \lim_{x\to b^-}f(x)=f(b)$$ but I don't quite get how can I prove that $f$ is bounded on interval $(a, b)$ using that.
 A: 
Proposition: Let $f:(a,b)\to\mathbb{R}$ be continuous (where $-\infty\leq a<b\leq\infty$) and suppose that $\lim_{x\to a^+}f(x),\lim_{x\to b^-}f(x)\in\mathbb{R}$. Then $f$ is bounded.

Proof: First of all, assume that $a,b\in\mathbb{R}$. As has been noted in the comments, we can extend $f$ to a continuous function on $[a,b]$, which must itself be bounded. Define $\tilde{f}:[a,b]\to\mathbb{R}$ by $\tilde{f}(x):=f(x)$ for $x\in(a,b)$, $\tilde{f}(a):=\lim_{x\to a^+}f(x)$ and $\tilde{f}(b):=\lim_{x\to b^-}f(x)$.
Since $f$ is continuous, $\lim_{x\to a^+}\tilde{f}(x)=\tilde{f}(a)$ and $\lim_{x\to b^-}\tilde{f}(x)=\tilde{f}(b)$, we have that $\tilde{f}:[a,b]\to\mathbb{R}$ is continuous on a closed, bounded interval, and therefore bounded. Since $f$ is a restriction of $\tilde{f}$ to $(a,b)$, it is then clear that $f$ is bounded.
Now we move on to the case where $a\in\mathbb{R}$ and $b=\infty$. Using the same reasoning as above, we can see that $\tilde{f}:[a,\infty)\to\mathbb{R}$ given by $\tilde{f}(x):=f(x)$ for $x>a$ and $\tilde{f}(a):=\lim_{x\to a^+}f(x)$ is continuous. We have that $L:=\lim_{x\to\infty}\tilde{f}(x)\in\mathbb{R}$, so there must exist $C>a$ such that for each $x\in\mathbb{R}$ with $x>C$, we have that $|\tilde{f}(x)-L|<1$. This shows that $\tilde{f}$ is bounded on $(C,\infty)$.
Then $\tilde{f}|_{[a,C]}:[a,C]\to\mathbb{R}$ is a continuous function on a closed, bounded interval, and therefore bounded. We conclude that $\tilde{f}$ is bounded on the whole of $[a,\infty)$ and therefore $f$ is bounded on $(a,\infty)$.
The argument for the case $a=-\infty$ and $b\in\mathbb{R}$ is symmetrical to the case for $a\in\mathbb{R}$ and $b=\infty$. Finally, if $a=-\infty$ and $b=\infty$, then we can find $C,D\in\mathbb{R}$ with $C<D$ for which $f$ is bounded on $(-\infty, C)$ and $(D,\infty)$ using the given limits. It must also be bounded on $[C,D]$ by continuity, giving that $f$ is bounded on $(-\infty,\infty)$, and we are done.
