# Is there a discontinuous function such that it is continuous on each restriction?

Let $X$ be a topological space such that $X=\bigcup_{n\ge 1}A_n$ with $A_n\subset A_{n+1}$ for each $n\ge 1$.

Is there a discontinuous function $f:X\to Y$ (where $Y$ is another topological space) such that $\left.f\right|_{A_n}$ is continuous for each $n\ge 1$?

Intuitively I believe this is impossible, but my intuition is always on "nice" spaces. So, if the above is true, I will probably need to work with weird spaces. Can you help me think of some?

• If the $A_n$ are open, then no. – user98602 Dec 16 '16 at 0:50
• @Mike Miller In Ian's example, $A_n$ seem open. – Momo Dec 16 '16 at 0:57
• @Momo They're not. If they were, the whole space would be discrete. – user98602 Dec 16 '16 at 0:59
• @Mike Miller You are right, they are not. – Momo Dec 16 '16 at 1:06
• This reminds me of Lusin's theorem, and of a result related to a theorem from Sierpinski : "There exists a function discontinuous on every set having positive Lebesgue outer measure." (see MARK MAHOWALD, On a paper of Maurice Sion, corollary 4.2). – Watson Dec 17 '16 at 12:36

## 3 Answers

Take

$$f(x)= \begin{cases} 1, &\text{ if }x>0\\ 0, &\text{ if }x\le 0\\ \end{cases}$$

Then take $A_n=(-\infty,0]\cup (1/n,\infty)$

$A_n\subset A_{n+1}$, $\bigcup_{n=1}^{\infty}A_n=\mathbb R$, $f$ is continuous on $A_n$, but $f$ is not continuous on $\mathbb R$

Take a countable topological space $A=(B,\tau)$ whose finite subspaces are discrete but which is not itself discrete, e.g. $\mathbb{Q}$ with its usual topology. Take an enumeration of $B$, call it $b_n$, and set $B_n=\{ b_1,\dots,b_n \}$. Then any function from $A$ into any topological space is continuous on each $B_n$. But since $A$ is not discrete, there is a topological space $C$ and a function $f : A \to C$ such that $f$ is not continuous. (Concretely, one may take $C$ to be the Sierpinski space and $f$ to be the indicator function of a singleton which is not open.)

Take an enumeration $q_n$ of $\mathbb{Q}$, and define $A_n:=\{q_1,\cdots, q_n\}$. Define $f:\mathbb{Q} \to \mathbb{R}$ by $f(x)=1$ if $x \neq 0$, and $f(x)=0$ if $x=0$.