Question in my work in the problem "if $f:[a,b]\to\mathbb{R}$ has finite limit in every point of $[a,b]$ then $f$ is bounded" Let $f:[a,b]\to\mathbb{R}$ a function such that $f$ has finite limit in every point $x \in [a,b]$, prove that $f$ is bounded.
I was thinking if this problem could be solved in the following way: since by hypothesis $f$ has finite limit for every $x \in [a,b]$, I can define $\tilde{f}:[a,b]\to \mathbb{R}$ such that $\tilde{f}$ has the same value of the limits of $f$ in every point of $[a,b]$. By doing this, $\tilde{f}$ is continuous in all $[a,b]$ and since $[a,b]$ is compact it follows that $\tilde{f}$ has absolute maximum and minimum in $[a,b]$ and these maximum and minimum are bounds for $f$ in $[a,b]$, hence $f$ is bounded. Could this work? If this is wrong, can someone explain me why it doesn't work? Moreover, is there a way to write formally the function $\tilde{f}$?
 A: It is true that $\tilde f : [a, b] \to \mathbb R$ defined by
$$ \tilde f (x) = \lim_{y\to x} f(x)$$
is continuous and thus bounded. You have not proved that yet and a proof can be found here.
Now the question is how that imply the original $f$ is bounded, and to be honest, I don't see how that is useful.
That's one proof: for each $x\in [a, b]$, there is $\delta=\delta(x) >0$ (depending on $x$) so that $|f(y) - \tilde f(x)|<1$ for all $y\in [a, b]$ and $0<|x-y|<\delta$. Then since $[a, b]$ is compact, there is $x_1, \cdots x_n\in [a, b]$ so that every $y\in [a,b]$ is in one of $(x_i- \delta_i , x_i+ \delta_i)$. Thus
$$ |f(y)|\le \max\{ |\tilde f(x_1)|+1, \cdots, |\tilde f(x_n)|+1, |f(x_1)|, \cdots, |f(x_n)|\}.$$
Note that continuity of $\tilde f$ is not used.
Another proof is argue by contradiction: suppose $f$ is not bounded, then for each $n\in \mathbb N$, one can find $y_n\in [a,b]$ so that $|f(y_n)|\ge n$. Since $[a, b]$ is compact, $\{y_n\}$ has a sub-sequence $\{ y_{n_k}\}$ which converges to $y_0\in [a,b]$. But then
$$\lim_{k\to \infty} f(y_{n_k}) = \lim_{y\to y_0} f(y)=\tilde f (y_0)$$
and this contradicts to $|f(y_{n_k})|\ge n_k$. But again, continuity or boundedness of $\tilde f$ is not used.
