Proving the set of points at which a function diverges to $\infty$ is countable

There was some discussion about the terminology in comments to the question -- I interpret the statement "if $y$ converges to $x$, then $f(y)$ converges to $\infty$" to mean "for all $M\in\mathbb{R}$ there is $\delta > 0$ such that $f(y)>M$ for all $y\neq x$ with $\lvert y-x\rvert < \delta$". Let $S$ be the set of all such points $x$, and call a set that contains uncountably many points of $S$ "uncountably divergent" for short.

I don't think that the $\arctan$ transformation is of any help, since it's just a homeomorphism between $\mathbb{R}$ and $(-\pi,\pi)$ and between $\mathbb{R}\cup\{\infty\}$ and $(-\pi,\pi]$ and doesn't change the substance of the required proof. [Edit, after seeing Nick Kirby's answer and following his links: The transformation does make a difference, in that the limit $\infty$ is not allowed as a function value here, whereas it is if it is finite. This difference is relevant with respect to the example of the function with removable discontinuities at all rationals given here, since this uses the limit at the rationals as the function value at the irrationals, which we can't do in the present case, so that this example doesn't yield an example of a function "converging to $\infty$" at the rationals -- in fact there is no such function; see the remark about nowhere dense sets below.]

Assume that $S$ is uncountable. First, observe that $[n,n+1]$ must then be uncountably divergent for some $n\in\mathbb{N}$. Without loss of generality, assume $n=0$, so $[0,1]$ is uncountably divergent.

Now we divide the interval in half. Either $[0,1/2]$ or $[1/2,1]$ or both are uncountably divergent. If only one of them is, we discard the other half and replace the interval by the uncountably divergent half and continue dividing it.

Assume that after each subdivision only one half is uncountably divergent. These halves form a chain of nested closed intervals whose intersection contains exactly one point. Thus, except possibly for one point, all points of $S$ in $[0,1]$ lie in one of the discarded halves that each contain at most countably many points of $S$. But there are only countably many of these halves, contradicting the fact that there are uncountably many points of $S$ in $[0,1]$. Hence the assumption is false and the subdivision must encounter an interval of which both halves are uncountably divergent.

Once we encounter such an interval, we denote it by $I$ and recursively apply the entire halving procedure to it (including the part where we discard intervals of which only one half is uncountably divergent). We call the two resulting intervals $I_0$ and $I_1$ and continue applying the halving procedure to them, resulting in intervals $I_{00}$, $I_{01}$, $I_{10}$, $I_{11}$, and so on, where each resulting interval has the property that both its halves are uncountably divergent.

We discard any points of $S$ lying in the discarded halves, as well as all points lying on a boundary of one of the intervals. Since there are only countably many such points, each interval that was uncountably divergent remains so. Note that each remaining point of $S$ in $[0,1]$ now lies in a chain of nested intervals $I$, $I_{i_1}$, $I_{i_1i_2}$, ... with lengths converging to $0$, and the intersection of that chain contains exactly that point.

We now begin with the interval $I$, choose some point $s$ of $S$ in it and find $\delta$ such that $f(y) > 1$ for all $y\neq s$ with $y \in (s-\delta,s+\delta)$. Now $s$ lies in a chain of nested closed intervals with lengths converging to $0$, so one of these intervals is entirely contained in $(s-\delta,s+\delta)$. Denote this interval by $I_i$, where $i$ is a string of binary digits, and choose the one of $I_{i0}$ and $I_{i1}$ which does not contain $s$, so that $f>1$ on this entire subinterval. We now apply the same procedure to this interval, choosing a point of $S$ in it but now choosing $\delta$ such that $f(y) > 2$.

Iterating this procedure, we obtain a chain of nested closed intervals whose lengths converge to $0$, and the intersection of these intervals contains exactly one point $t$. But now $f(t)>n$ for all $n\in\mathbb{N}$, which is impossible. Hence $S$ must be countable.

[Edit: Note that uncountability was only used to make sure that we have points in both halves of an interval at every level of subdivision -- thus, we can use the same proof to show that $S$ is nowhere dense (except for the "removable technicality" that we discarded the set of boundary points, i.e. the set of points with finite binary representation, which is itself dense -- this was just to ensure that each point of an interval is contained in exactly one of the closed subintervals, but we can alternatively ensure that by choosing one of the four sub-subintervals, at most two of which contain the given point.). The same is not true for the case of finite limits (i.e. limits which are allowed as function values elsewhere), as the example of the function with removable discontinuities at all rationals shows. The crucial difference is in the last step of the proof, since $f(t)>n$ for all $n\in\mathbb{N}$ is impossible, whereas the corresponding statement for the limit $0$, $\lvert f(t)\rvert<1/n$ for all $n\in\mathbb{N}$, is consistent.]


For completeness, here is a direct proof without the $\arctan$ transformation using the ideas in the book cited in Nick Kirby's answer (where the proof of the part of the theorem relating to removable discontinuities is left as an exercise).

Let $S_{mn}$ with $m,n\in \mathbb{N}$ be the set of all points $x$ such that $f(x) < m$ and $f(y) > m$ for all $y\neq x$ with $x-1/n<y<x+1/n$. For each point $x$ at which $f$ "converges to $\infty$" (in the sense explicated in my other answer), we can choose $m > f (x)$, and then choose $n$ such that $f(y) > m$ for all $y\neq x$ with $x-1/n<y<x+1/n$. Thus each point at which $f$ "converges to $\infty$" is contained in one of the sets $S_{mn}$. But none of these sets has an accumulation point, since that would imply that there are two points which are less than $1/n$ apart, both of whose function values are below $m$ and both of which have a neighbourhood of radius $1/n$ where the function values are above $m$, which is impossible. Hence each $S_{mn}$ is countable, and the set of points at which $f$ "converges to $\infty$", being the countable union of these countable sets, is also countable.

[Edit: Note that this proof substantially uses countability and can't be adapted to nowhere-denseness as immediately as the proof in my other answer. This is because although each $S_{mn}$ is not only countable but also nowhere dense, this property, unlike countability, is not necessarily inherited in a countable union. Thus, we cannot exclude on the basis of this proof alone that the union of all $S_{mn}$ might be dense in $\mathbb{R}$, as demonstrated by the example of the function with removable discontinuities at all rationals. However, the union of all $S_{mn}$ with bounded $m$ cannot be dense anywhere, and it is this necessary unbounded growth of $m$ that in the present case precludes denseness, since we cannot have $\infty > m$ for all $m\in \mathbb{N}$ as a function value, whereas we can have $0 < 1/m$ for all $m\in \mathbb{N}$ as a function value in the finite case.]


Notice that $g(x)=\arctan(f(x))$ has a removable discontinuity at points $x$ such that $\lim_{t\to x} f(t)=\infty$. Therefore, the countability of the set of interest can be seen as a consequence of the fact discussed here: Is there a function with a removable discontinuity at every point? and particularly, Chandru1's link: Chandru1's link to Theorem 5.63, which proves that the set of removable discontinuities is at most countable.