Problem: Let $f(x)$ be a real valued functions defined on $\mathbb{R}$, prove that the point set $$E = \{x\in \mathbb{R}: \lim_{y\rightarrow x} f(y) = +\infty\}$$ is a finite or a countable set.
Proof: Let $g(x) = \arctan f(x), x \in \mathbb{R}$. Then the point set $E$ can be written as $$E = \{x\in \mathbb{R}: \lim_{y\rightarrow x} g(y) = \frac{\pi}{2}\}$$ Therefore $E$ is a finite or a countable set.
The above proof is from a textbook of real analysis. How can we see that the set $E$ in this proof is finite or countable?
Right now, I have no idea why we can see immediately that $ E=\{ x\in \mathbb{R} \;|\;\lim_{y\to x} g(y) = \frac{\pi}{2}\} $ is at most countable. But I've found the following argument that shows the set $E$ is at most countable.
Proof: Assume $x \in E$. If $f(x)< n$, then since $\lim_{y\to x}f(y) =\infty$, we can find a $\delta>0$ such that $$ (x-\delta,x)\cup (x,x+\delta) \subset f^{-1}((n,\infty)). $$ Now consider the open set $$U_n=\text{int}f^{-1}((n,\infty)) = \bigcup_{k=1}^\infty (\alpha_k, \beta_k)$$ where $\{(\alpha_k, \beta_k)\}$ is a disjoint family of open intervals. The above argument shows that $x$ is one of the end points $\alpha_k$ or $\beta_k$ of $U_n$ for some $n\ge 1$. Since there are at most countably many such end points, it follows that $E$ is countable. $\blacksquare$
After watching the above argument, I felt it is not trivial and it made me think that it is probably author's confusion, or there may be some results that the author did not mention.