Prove that the number of jump discontinuities is countable for any function

Let $f:(a,b)\to \mathbb{R}$ and $$A=\left\{x\in (a,b):f\text{ has a jump discontinuity at $x$}\right\}$$ Now $$A=A^{+}\cup A^{-}$$ where $$A^{+}=\left\{x\in (a,b):\lim_{y\to x^+}f(y)>\lim_{y\to x^-}f(y)\right\}$$ and $$A^{-}=\left\{x\in (a,b):\lim_{y\to x^+}f(y)<\lim_{y\to x^-}f(y)\right\}$$ I will show $A^{+}$ is countable and leave the rest to you. Fix $x\in A^{+}$ and then $\exists q\in \mathbb{Q}$ so that $$\lim_{y\to x^+}f(y)>q>\lim_{y\to x^-}f(y)$$ (why???). This means that $\exists \delta>0$ so that $$x-\delta<y<x<z<x+\delta\implies f(z)>q>f(y)$$ and so (why?) $\exists n\in \mathbb{N}$ so that $$x-\frac1n<y<x<z<x+\frac1n\implies f(z)>q>f(y)$$ If we let $$A_{q,n}=\left\{x\in (a,b):x-\frac1n<y<x<z<x+\frac1n\implies f(z)>q>f(y)\right\}$$ ($q\in \mathbb{Q}$,$n\in \mathbb{N}$) then by our previous discussion $$A^{+}\subseteq\bigcup_{q\in \mathbb{Q}}\bigcup_{n\in \mathbb{N}}A_{q,n}$$ Therefore the problem moves to proving that $A_{q,n}$ is countable. This follows from the fact $A_{q,n}$ is isolated (show this!).


The argument below is essentially the one outlined in Robert Israel's post here, but I tweak it a bit to show that there are only countably many removable discontinuities as well.

Let $f:\mathbb{R}\rightarrow\mathbb{R}$ be a function. The key idea is that we can control the amount of fluctuation in $f$ (and hence the size of jumps) on the left (resp., right) side of a point $x$ where the left limit (resp., right limit) exists by taking points sufficiently close to $x$. We cannot guarantee that there are no jumps in a neighborhood of a jump discontinuity; for example, the function $g:[-1,1]\rightarrow\mathbb{R}$ given by

$$g(x) = \begin{cases} \phantom{-}1 & \text{if}\ x\leq0 \\ 1/n & \text{if}\ n \text{ is a positive integer and } 1/(n+1)<x\leq 1/n \end{cases}$$

has a jump discontinuity at and in every neighborhood of $0$ (a more pathological example is given in iballa's comment on Koushik's post; see also Brian Scott's post here for details). However, it is true that we can make jumps around a jump discontinuity as small as desired by taking a sufficiently small neighborhood (but we actually only use a slightly weaker result -- see below). To that end, we note that the definition of the left limit and the triangle inequality give the

Lemma. If $f(x-)=\lim_{t\rightarrow x^-} f(t)$ exists then for any $\varepsilon > 0$ we have some $\delta>0$ such that $$\mathrm{diam} f(x-\delta,x) < \varepsilon. \Box$$

Now for any $x\in\mathbb{R}$ where $f(x-), f(x+)$ exist, put

$$M(x)=\max\{|f(x)-f(x-)|,|f(x)-f(x+)|\},$$

and for any $\varepsilon>0$, let

$$\mathcal{J}(\varepsilon)=\{ x\in\mathbb{R} : f(x-),f(x+) \text{ exist and } M(x)>\varepsilon \}.$$

Since any point $x$ at which a jump or removable discontinuity occurs lies in $\bigcup_n \mathcal{J}(1/n),$ it suffices to show that each $\mathcal{J}(\varepsilon)$ is countable. Fix $x\in\mathcal{J}(\varepsilon)$ and take $\delta>0$ such that $\mathrm{diam} f(x-\delta,x) < \varepsilon.$ If $t_0$ is an element of $(x-\delta, x)$ such that $f(t_0-), f(t_0+)$ exist then the sequences $f(t_0-1/n), f(t_0+1/n)$ eventually lie in

$$f(x-\delta,x) \subset [f(t_0)-\varepsilon, f(t_0)+\varepsilon],$$

so that

$$f(t_0 -)=\lim_{n\rightarrow\infty} f(t_0-1/n) \in [f(t_0)-\varepsilon, f(t_0)+\varepsilon]$$

and

$$f(t_0 +)=\lim_{n\rightarrow\infty} f(t_0+1/n) \in [f(t_0)-\varepsilon, f(t_0)+\varepsilon].$$

Consequently, we have $M(t_0)\leq\varepsilon$, and we deduce that $(x-\delta, x)$ and $\mathcal{J}(\varepsilon)$ are disjoint. Letting $q_x$ be any rational number in $(x-\delta, x),$ the map $x\mapsto q_x$ yields an injection $\mathcal{J}(\varepsilon)\rightarrow\mathbb{Q},$ completing the proof.