# Extending continuous functioms defined on the irrationals

Lavrentieff proved a Theorem which implies that every real valued continuous function defined on a dense subset $$D\subseteq \mathbb R$$ admits a continuous extension to some $$G_\delta$$ subset of $$\mathbb R$$. See Theorem (4.3.20) in "General Topology" by Engelking, or this Mathematics Stack Exchange post.

If the dense subset $$D$$ is already a $$G_\delta$$, such as the set of irrational numbers, Lavrentieff's Theorem of course says nothing. So let us be a bit more audacious:

Given a real valued continuous function $$f$$ defined on $$\mathbb R\setminus \mathbb Q$$, is there an open subset $$U$$ of $$\mathbb R$$, containing all irrational numbers, and a continuous extension of $$f$$ to U?

Enumerate the rationals as $$\{q_n\}$$ and define $$f(x) = \sum_{n : q_n < x} 2^{-n}$$. Then $$f$$ is continuous on $$\mathbb{R} \setminus \mathbb{Q}$$ but cannot be extended continuously to any proper superset of $$\mathbb{R} \setminus \mathbb{Q}$$.