The book states:
$\textbf{Proposition 2}$: Let $C$ be a countable subset of the open interval $(a, b)$. Then there is an increasing function on $(a, b)$ that is continuous only at points in $(a, b) \setminus C$
$\textbf{Proof}$ If $C$ is finite the proof is clear. Assume $C$ is countably infinite. Let $\{q_n\}_{n = 1}^\infty$ be an enumeration of $C$. Define the function $f$ on $(a, b)$ by setting $$f(x) = \sum_{\{n | q_n \leq x\}} \frac{1}{2^n} \text{ for all } a < x < b.$$
Since a geometric series with a ratio less than 1 converges, $f$ is properly defined. Moreover, $\begin{align}\text{if } a < u < v < b \text{, then } f(v) - f(u) = \sum_{\{n | u < q_n \leq v\}} \frac{1}{2^n}.\end{align}$
Thus $f$ is increasing. Let $x_0 = q_k$ belong to $C$. Then, by (1),
$$f(x_0) - f(x) \geq \frac{1}{2^k} \text{ for all } x < x_0.$$
Therefore $f$ fails to be continuous at $x_0$. Now let $x_0$ belong to $(a, b) \setminus C$. Let $n$ be a natural number. There is an open interval $I$ containing $x_0$ for which $q_n$ does not belong to $I$ for $1 \leq k \leq n$. We infer from (1) that $|f(x) - f(x_0)| < 1/2^n$ for all $x \in I$. Therefore $f$ is continuous at $x_0$. Q.E.D.
Ok, I have read the last few sentences, about showing $f$ is continuous on the irrational numbers, a hundred times and I still cannot see why what Royden has written shows that $f$ is continuous on the irrational numbers. Could someone explain it to me in a more expounded upon way? He is too terse here for me to decipher.
Starting at $x_0$, there is some neighborhood of $x_0$ that doesn't contain $\{q_1,\dots,q_n\}$. We might have to make this neighborhood very small, if one of these $q_k$'s is close to $x_0$, but eventually we can avoid all of them (since there are only finitely many).
Another way of thinking about this is that $$\inf_{1\leq k\leq n}|x_0 - q_k| = \min_{1\leq k\leq n}|x_0 - q_k|$$ since the $\inf$ is taken over finitely many things, and that $$\min_{1\leq k\leq n}|x_0 - q_k| > 0$$ since $x_0 \in (a,b) \backslash C$.
Now, suppose $x_0 > q_k$ for some $k \leq n$. Then, for every other $x$ in this interval, we have $x > q_k$ as well, since $q_k$ isn't in this interval (i.e. $q_k$ is either to the left or right of all the points in this interval). So, when we go to check the value of $f$ at $x$ vs. the value of $f$ at $x_0$, the contribution to the sum from $\{q_1,\dots,q_n\}$ will be the same. The contribution from other $q_k$'s for $k>n$ might be different, but this difference will be at most
$$ \sum_{k>n}\frac{1}{2^k} < 1/2^n. $$