Consider the following pathological function $g : [-1,1) \to \{-1,1\}$ constructed in stages, where $x \in [-1,1)$. Each stage $n$ adds rationals of the form $\{\pm\frac{m}{n+1}\}$ as jump discontinuities such that $|\frac{m}{n+1}| < 1$ for the denominator $k \in\{1,2,3,...,n+1\}$, where $m \in \{1,2,3,..., k-1\}$. \begin{align} g_0 (x) & = \begin{cases}-1, x \in [-1,0)\\ 1, x \in [0,1)\end{cases}\\ g_1 (x) & = \begin{cases}-1, x \in [-1,-\frac{1}{2})\\1, x \in [-\frac{1}{2},0)\\-1, x \in [0,\frac{1}{2})\\1, x \in [\frac{1}{2},1)\end{cases}\\ g_2 (x) & = \begin{cases}-1, x \in [-1,-\frac{2}{3})\\1, x \in [-\frac{2}{3},-\frac{1}{2})\\-1, x \in [-\frac{1}{2},-\frac{1}{3})\\1, x \in [-\frac{1}{3},0)\\-1, x \in [0,\frac{1}{3})\\1, x \in [\frac{1}{3},\frac{1}{2})\\-1, x \in [\frac{1}{2},\frac{2}{3})\\1, x \in [\frac{2}{3},1)\end{cases}\\ \vdots \end{align}
For clarity, the sequences of jump discontinuities at each stage is: \begin{align} \{0\}\\ \{-\frac{1}{2},0,\frac{1}{2}\}\\ \{-\frac{2}{3},-\frac{1}{2},-\frac{1}{3},0,\frac{1}{3},\frac{1}{2},\frac{2}{3}\}\\ \{-\frac{3}{4},-\frac{2}{3},-\frac{1}{2},-\frac{1}{3}, -\frac{1}{4},0,\frac{1}{4},\frac{1}{3},\frac{1}{2},\frac{2}{3},\frac{3}{4}\}\\ \vdots \end{align} thus when $n \to \infty$ the set of jump discontinuities will be $\Bbb{Q}$
Below is an illustration of $g_0,g_1,g_2,g_3$
So in the limiting stage as $n \in \Bbb{N}$, we have $g(x)$ obtained that locally look like $\pm g_0(x)$ for every rational $x$, thus it is discontinuous at every rational.
However, it seems while the one-sided limits $\lim_{x\to a^{\pm}} g_n(x)$ is well defined for stage $n$, I have trouble determining whether one-sided limits of $g$ exists at all due to the oscillation, making it quite unlike the Dirichlet function
What tools should I use to analyse the class of discontinuities in $g$?
How to compute $g(r)$ where $r$ is irrational. While $g_n(r)$ is well defined for all $r \in \Bbb{I}$ by construction, it seems when $n \to \infty$, $g$ oscillate so much that $g(r)$ is not well defined?
