# Does there exists a function $f:\Bbb{R}\to \Bbb{R}$ s.t $f$ is continuous on a dense $G_{\delta}$ set and discontinuous a.e on $\Bbb{R}$?

Does there exists any function $$f:\Bbb{R}\to \Bbb{R}$$ such that $$f$$ is continuous on a dense $$G_{\delta}$$ subset of $$\Bbb{R}$$ and discontinuous almost everywhere on $$\Bbb{R}$$ ?

Attempt : (Yes)

We know the real line $$\Bbb{R}$$ can be decomposed into disjoint union of two small sets i.e $$\Bbb{R}=N\cup M$$ where $$N$$ is Lebesgue null and $$M$$ is meager (see here).

Since $$\Bbb{R}$$ is second category (non-meager) and $$M$$ is meager implies $$N$$ is of second category. Since complement of a first category set contains a dense $$G_{\delta}$$ subset of $$\Bbb{R}$$ , let $$G\subset N$$ a dense $$G_{\delta}$$ subset of $$\Bbb{R}$$.

According to this How to construct a real valued function which is continuous only on a given $G_\delta$ subset of $\mathbb{R}$? , we can construct a function which is continuous only on $$G$$ .

As $$N$$ is Lebesgue null and $$G\subset N$$ implies $$m(G) =0$$ . Hence $$f$$ is discontinuous everywhere.

Is my approach is correct ?

Edit: I can produce an explicit $$G_{\delta}$$ set of measure $$0$$.

• Nothing simpler that I can think of off-hand. Existence is immediate from two fairly standard and well-known results -- any $G_{\delta}$ set can be the discontinuity set of a function and there exists dense $G_{\delta}$ sets having measure zero. The first result can be proved by a suitable generalization of how one can show continuity at the irrationals of the Thomae function (see "Proof Sketch" here) and the second result is a consequence of the fact (continued) Jul 13 at 19:44
• that any measurable set is contained in a $G_{\delta}$ set of the same measure (outer regularity of Lebesgue measure; let the measurable set be the rationals). Whether this can be simplified by using certain explicit constructions depends on what extent you feel it is legitimate to cite some or all of these more general results. Is it simpler to prove everything from scratch (e.g. define an explicit dense $G_{\delta}$ set containing the rationals rather than cite a standard measure theory fact) despite having lots of "hair" involved, or is it simpler to assume and cite standard results? Jul 13 at 19:44
• I just noticed that the "Proof Sketch" I cited proves something slightly less general (not for an arbitrary $G_{\delta}$ set), but since you're only concerned with dense $G_{\delta}$ sets, the method there can be used here. Jul 13 at 19:49
• @Sassatelli Giulio: It looks like you've identified a wording oversight everyone has missed so far! It appears that "continuous" needs to be deleted in (at least) 3 places: (1) the first use of "continuous" in the title, (2) the first use of "continuous" in the first sentence, (3) the second use of "continuous" in the sentence beginning with "According to this". Jul 13 at 20:38
• @DaveL.Renfro In your first comment, where you said "any $G_\delta$ set can be the discontinuity set", I think you meant "continuity set".
– bof
Jul 14 at 3:07

The first part - existence of null dense $$G_\delta$$ set - can be show explicitly: let $$q_n$$ be enumeration of rationals, let $$U_k = \bigcup_n (q_n - 2^{-n-k}, q_n + 2^{-n-k})$$, then $$\cap_k U_k$$ is null (as $$\mu(U_k) \leq 2^{-k}$$), dense (as it contains $$\mathbb Q$$) and $$G_\delta$$ (as each $$U_k$$ is open).
I don't see any construction simpler than general to find a function continuous exactly on this set, but if we substitute our $$U_k$$ in general construction, we get pretty much explicit function.