# Set of continuity points of a real function

I have a question about subsets
for which there exists a function such that the set of continuity points of $f$ is $A$. Can I characterize this kind of sets? In a topological,measurable or in some way? For example, does there exist a function continuous on $\mathbb Q$ and discontinuous on the irrationals?

1. Let $$XX$$ be a metric space, and let $$f:X→Rf: X \rightarrow \mathbb{R}$$ be any function. For any $$ϵ>0\epsilon > 0$$, let us say that a point $$x∈Xx \in X$$ has property $$C(f,ϵ)C(f,\epsilon)$$ if there exists $$δ>0\delta > 0$$ such that $$d(x,x′),d(x,x″d(x,x'), d(x,x'') < \delta \implies |f(x')-f(x'')| < \epsilon$$. If $$x \in Xx \in X$$ has property $$C(f,\epsilon)C(f,\epsilon)$$, then so does every point in a sufficiently small $$\delta\delta$$-ball about $$xx$$, so the locus of all points satisfying property $$C(f,\epsilon)C(f,\epsilon)$$ is an open subset. Moreover, $$ff$$ is continuous at $$xx$$ iff $$xx$$ has property $$C(f,\frac{1}{n})C(f,\frac{1}{n})$$ for all $$n \in \mathbb{Z}^+n \in \mathbb{Z}^+$$. This shows that the locus of continuity of f -- i.e., the set of $$xx$$ in $$XX$$ such that $$ff$$ is continuous at $$xx$$ -- is a countable intersection of open sets, or in the lingo of this subject, a $$G_{\delta}G_{\delta}$$-set.
2. If $$x \in Xx \in X$$ is an isolated point -- i.e., if $$\{x\}\{x\}$$ is open in $$XX$$; or equivalently, if for some $$\delta > 0\delta > 0$$ the $$\delta\delta$$-ball around $$xx$$ consists only of $$xx$$ itself -- then every function $$f: X \rightarrow \mathbb{R}f: X \rightarrow \mathbb{R}$$ is continuous at $$xx$$. This places a further restriction on the locus of continuity: it must contain the subset of all isolated points. For instance, if $$XX$$ is discrete then the locus of continuity of any $$f: X \rightarrow \mathbb{R}f: X \rightarrow \mathbb{R}$$ is all of $$XX$$, so certainly not every $$G_{\delta}G_{\delta}$$-set is a locus of continuity!
3. Conversely, let $$Y \subset XY \subset X$$ be a $$G_{\delta}G_{\delta}$$-set which contains all isolated points of $$XX$$. Then $$YY$$ is a locus of continuity: there exists a function $$f: X \rightarrow \mathbb{R}f: X \rightarrow \mathbb{R}$$ which is continuous at $$xx$$ iff $$x \in Yx \in Y$$. A short, elegant proof of this is given in this 1999 note of S.S. Kim.
Note that since $$\mathbb{R}\mathbb{R}$$ has no isolated points, here the result of 3) reads that every $$G_{\delta}G_{\delta}$$-subset of $$\mathbb{R}\mathbb{R}$$ is a locus of continuity. But one might as well record the general case -- it's no more trouble...