TITLE: Proving the set of points at which a function diverges to $\infty$ is countable
QUESTION [14 upvotes]: Let $f\colon\mathbb{R}\to\mathbb{R}$. Prove that the set 
  $$\{x \mid \mbox{if $y$ converges to $x$, then $f(y)$ converges to $\infty$}\}$$ is countable.

My book told me to consider  $g(x)=\arctan(f(x))$, then it said "it is easy to see the set is countable." But I still can't understand what it mean.

REPLY [5 votes]: If we allow $f$ to be a partial function, that is, where the domain is only a subset of $\mathbb{R}$ rather than all of $\mathbb{R}$, then there is an interesting counterexample. 
Namely, let $C\subset\mathbb{R}$ be the usual Cantor set, and let $U=\mathbb{R}-C$ be the complement, an open set. For any real $x\in U$, let $$f(x)=\frac{1}{d(x)},$$ where $d(x)$ is the distance from $x$ to $C$, which is nonzero for all $x\in U$. Note that for any sequence $y_n\in U$ with $y_n\to x\in C$, we have $d(y_n)\to 0$ and hence $f(y_n)\to\infty$. (Note also that every $x\in C$ is a limit of points in $U$.) Since the Cantor set has uncountable size continuum, we have therefore an uncountable set of points where $f$ diverges to infinity. Furthermore, $f$ is continuous on its domain $U$.