Suppose $f:\mathbf{R}\to\mathbf{R}$ is a function. Let $S=\{x\in \mathbf{R}|f\text{ is continuous at }x\}$. Does $S$ have any nice properties?


Here are some observations about what $S$ could be:


* $S$ can be any closed set. For a closed set $S$, let $g$ be a continuous function whose vanishing locus is $S$ (for example, you could take $g(x)$ to be the distance of $x$ from $S$ if $S$ is non-empty). Then define
$$
f(x) =
\begin{cases} 
g(x) &\text{if }x\in \mathbf{Q}\\
0 &\text{otherwise}.
\end{cases}
$$
Then the continuous locus of $f$ is exactly $S$.
* $S$ can be an open interval. For an open interval $S$, define
$$
f(x) =
\begin{cases} 
0 &\text{if }x\in S \wedge x\in\mathbf{Q}\\
1 &\text{otherwise}.
\end{cases}
$$ Then the continuous locus of $f$ is exactly $S$.
* $S$ can be the complement of any countable set. Let $T =
\{t\_1,t\_2,t\_3,\ldots\}=\{t\_i\}\_{i\in\mathbf{N}}$ be a countable set, and let $\sum\_i a\_i$ be some absolutely convergent series all of whose terms are non-zero (like $a\_i=\frac{1}{2^i}$). Define
$$
f(x) = \sum\_{i\text{ s.t. }t\_i < x} a\_i.
$$
Then the continuous locus of $f$ is exactly the complement of $T$.


Here are some questions I'd like to know the answers to:


* Can $S$ be any open set?
* Can $S$ be non-measurable? (if $$
f(x) =
\begin{cases} 
0 &\text{if }x\in S\\
1 &\text{otherwise}.
\end{cases}
$$
$f(x)=0$ if $x\in S$ and $f(x)=1$ otherwise, what will the continuous locus be?)



Does the "continuous locus" of a function have any nice properties?
Yes, here's a quick proof that any given $G\_\delta$ (in $\mathbb{R}$) can be realized as the set of continuity points of some real-valued function.


Let $G$ be a given $G\_\delta$ set in $\mathbb{R}$, meaning $G = \cap\_{i=1}^\infty G\_i$, each $G\_i$ an open set. Define a function $f:\mathbb{R} \to \mathbb{R}$ as follows: $f(x)=0$ if $x$ is in $G$. If x is not in $G$, there is some $k$ such that $x$ is not in $G\_k$; let $k$ be minimal with that property. Define $f(x)=1/k$ if $x$ is rational and $f(x)=-1/k$ if $x$ is irrational. 


If I'm not very much mistaken, $G$ is precisely the set of continuity points of this $f$. I'm happy to leave this as an exercise for now :-) Let me know if you're not sure how to do it, or - worse - if I'm just wrong about the construction.


