# If $f:[a,b]\to\mathbb{R}$ continuous at all but countably infinitely many points, $g:[0,1]\to[a,b]$ continuous, can $f\circ g$ be a.e. discontinuous?

Let $$f:[a,b]\to\mathbb{R}$$ be continuous except at $$\{x_1,x_2,\cdots,x_n,\cdots\}$$, $$g:[0,1]\to[a,b]$$ be a continuous function. My question is: can the points of discontinuity of $$f\circ g$$ have full measure?

The set of points of discontinuity of $$f\circ g$$ is included in $$\bigcup^\infty_{n=1} \partial g^{-1}(x_n)$$, where $$\{\partial g^{-1}(x_n)\}_{n\ge 1}$$ is a countably infinite collection of disjoint closed sets with empty interior. I'm well aware that a subset of $$[0,1]$$ with full measure can be written as a countable union of closed sets with empty interior (there are many simple constructions), but I don't know if there is a subset of $$[0,1]$$ with full measure that is a countable union of disjoint closed sets with empty interior. Also, even there is a subset $$E$$ of $$[0,1]$$ with full measure such that $$E = \bigcup^\infty_{n=1} C_n$$, where $$\{C_n\}$$ are disjoint closed sets with empty interior, can we find $$\{x_1,x_2,\cdots,x_n,\cdots\}$$ and define a continuous function $$g$$ such that $$g^{-1}(x_n) = C_n$$?

Edit: Note that $$f\circ g$$ cannot be a.e. discontinuous if $$f$$ has only finitely many points of discontinuity, since $$\bigcup^{N}_{n=1} \partial g^{-1}(x_n)$$ would be closed and, by Baire category theorem, have empty interior, so it cannot have full measure. On the other hand, the set of points of discontinuity of $$f\circ g$$ can have measure arbitrarily close to 1, even if $$f$$ is just discontinuous at one point.

Here is an example:

We use an auxiliary continuous function $$\chi: [0, 1] \to [0,1]$$ such that $$\chi(0) = \chi(1) = 0$$, $$\chi(1/2) = 1$$, and $$\chi^{-1}(\mathbb{Q})$$ has full measure.

To construct $$g: [0,1] \to [0,1]$$, take a map $$t: \mathbb{Z}_+ \to \mathbb{Q} \cap [0,1]$$ such that each rational in $$[0,1]$$ appears in the image infinitely many times. Consider $$g = \sum_{n = 1}^{\infty} c_n\chi_{I_n}$$ where $$\chi_{I_n}$$ is a scaling of $$\chi$$ function such that its support is $$I_n =[t_n - \ell_n, t_n + \ell_n]$$, and $$c_n \in \mathbb{Q}^+$$ with $$c_n \leq 2^{-n}$$ and $$\ell_n \leq 2^{-n}q_n^{-3}$$, $$q_n$$ being the denominator of $$t_n$$. Then by uniform convergence, $$g$$ is continuous. Furthermore, $$g$$ has the following property:

1. By choosing $$c_n$$ appropriately, $$g(\mathbb{Q})$$ can be disjoint from $$\mathbb{Q}$$. To achieve this, for each $$q \in \mathbb{Q} \cap [0,1]$$, let $$n \in S_q$$ be the set of $$n$$ such that $$I_n$$ is centered at $$q$$. $$q$$ lies in the intervals $$\{I_n\}_{n \in S_q}$$ plus finitely many other intervals $$\{J_m\}$$. Thus, it suffice to take the $$c_n$$ for $$n \in S_q$$ such that $$\sum_{n \in S_q} c_n$$ is outside the $$\mathbb{Q}$$-span of $$\{1, \chi_{J_m}(q)\}_m$$.

2. $$g^{-1}(\mathbb{Q})$$ has measure $$1$$, as each number in its complement must either appear in infinitely many $$I_n$$, or is in $$\chi_{I_n}^{-1}(\mathbb{R} \backslash \mathbb{Q})$$ for some $$n$$, both of which have measure zero.

Now let $$f(p/q) = 1/q$$ for any $$p/q \in \mathbb{Q}$$, and let $$f \equiv 0$$ outside $$\mathbb{Q}$$. Then $$f$$ is continuous except on $$\mathbb{Q}$$, but $$f \circ g$$ is discontinuous on $$g^{-1}(\mathbb{Q})$$.

Note: $$\chi$$ itself can be constructed similar to the cantor set. Given a tenary representation $$0.a_1a_2\cdots$$ of a number in $$[0,1]$$, let $$i$$ be the first such that $$a_i = 1$$, then let $$\eta(a) = \sum_{j = 1}^{i - 1} 2^{-j - 1}a_j + 2^{-i}.$$ Then $$\eta(0) = 0, \eta(1) = 1$$, and $$\eta^{-1}(\mathbb{Q})$$ is full measure. Glue two copies of $$\eta$$ together to get $$\chi$$.

• Thanks for your answer! What I don't stand is that $x$ appears in only finitely many $I_n$ implies that $g(x)\in A$. $\chi_n(x)$ can be strictly between $(0,1)$, right? So I don't understand why should $g(x)\in A$ be true in this case. The same applies for the property 1, $q\in \mathbb{Q}\cap [0,1]$ appears in infinitely many $[t_n-2^{-n-1},t_n+2^{-n-1}]$ does not seem to guarantee that $g(q)$ is not of the form $\frac{k}{2^l}$ since $\chi_n(q)$ can be strictly between $(0,1)$. What am I missing here? May 9, 2022 at 5:04
• I have edited the answer to address these issues. May 9, 2022 at 14:14
• Bravo! Brilliant answer indeed. Just one comment: is it better to change to exponent in $q^{-2}_n$ to $q^{-(2+\varepsilon)}_n$, to guarantee that the numbers appear in infinitely many intervals have zero measure? Because I've heard that, for any irrational $x$ there exists infinitely many $p,q$ such that $|x - p/q|<1/q^2$. May 10, 2022 at 12:54
• @JianingSong . A stronger result is there are infinitely many $p,q\in\Bbb Z$ such that $|x-p/q|<1/(q^2\sqrt 5)$, which is the best possible, in the sense that in the case $x=(1+\sqrt 5)/2$, if $k>\sqrt 5$ then there are only finitely many $p,q\in \Bbb Z$ with $|x-p/q|<1/(kq^2)$. May 14, 2022 at 19:27