5

Recently I saw Thomae's Function, also called the Popcorn Function, which is continuous at the irrationals and discontinuous at the rationals.

This made me wonder: is there a function which is continuous at every transcendental number and discontinuous at every algebraic number?

cpiegore
  • 1,490

1 Answers1

11

Sure, the idea behind Thomae's function easily generalizes to any countable set. Let $S\subset\mathbb{R}$ be any countable set and let $i:S\to\mathbb{Z}_{>0}$ be an injection (or more generally, any finite-to-one function). Define $f:\mathbb{R}\to\mathbb{R}$ by $f(x)=0$ if $x\not\in S$ and $f(x)=1/i(x)$ if $x\in S$. Then $f$ is continuous at a point $x\in\mathbb{R}$ iff $x\not\in S$ (the proof is very similar to that for Thomae's function).

More generally, it can in fact be shown that a subset $S\subset\mathbb{R}$ is the points of discontinuity of some function $\mathbb{R}\to\mathbb{R}$ iff it is $F_\sigma$ (i.e., a countable union of closed sets).

Eric Wofsey
  • 330,363