# A sequence of continuous functions cannot converge to a function discontinuous in (a,b)

My professor asked me to show that there cannot exist a sequence of continuous functions converging to $f:[0,1]\rightarrow$ {$0,1$} defined to be $0$ at rational and $1$ at irrational. Instead I am trying to prove the following more general theorem which I don't know if it is true.
Theorem:
Let $f:E\rightarrow\mathbb{R}$, $E\subset \mathbb{R}$ be a function such that there exist $(a,b)\subset E$ so that $f$ is discontinuous everywhere on $(a,b)$, then it cannot exist a sequence of continuous functions {$f_n$}$\rightarrow f$ pointwise.

Proof:
We start by claiming that there exists $\epsilon^*>0$ such that for all $\delta>0$ there exists $x,y \in (a,b)$ with $|x-y|<\delta$ but $|f(x)-f(y)|>2\epsilon^*$. Suppose otherwise then for all $\epsilon$ there exists $\delta>0$ such that $|x-y|<\delta\Rightarrow|f(x)-f(y)|<2\epsilon$. That implies $f$ is uniformly continuous on $(a,b)$ a contradiction.

Assume ${f_n}\rightarrow f$ pointwise and fix $\epsilon>0$ and let $\delta_n^\epsilon$ :=sup{$\delta\mid |x-y|<\delta\Rightarrow|f_n(x)-f_n(y)|<\epsilon$}. Clearly since {$f_n$} are continuous for all $n$ we conclude that $\delta_n^\epsilon\neq \emptyset$. So we can define $d_\epsilon$:=inf{$\delta_n^\epsilon$}.Now if $d_\epsilon=0$ then for all $m>0$ there exists $N_m$ and $a_{N_m}, b_{N_m}$ such that $0<|a_{N_m}-b_{N_m}|<1/m$ but $|f_{N_m}(a_{N_m})-f_{N_m}(b_{N_m})|>\epsilon$. Without loss of generality we may assume $lim_{m\rightarrow\infty}N_m=\infty$ and that $\lim_{m\rightarrow \infty}(a_{N_m})=L$ because we can always choose a subsequence satisfying that.We note we must have that $\lim_{m\rightarrow \infty}|f_{N_m}(a_{N_m})-f_{N_m}(b_{N_m})|>\epsilon$, however $\lim_{m\rightarrow \infty}(a_{N_m})=\lim_{m\rightarrow \infty}(b_{N_m})=L$ so since $f_n$ are continuous and {$f_n$}$\rightarrow f$ we must have $\lim_{m\rightarrow \infty}|f_{N_m}(a_{N_m})-f_{N_m}(b_{N_m})|=|f(L)-f(L)|=0$ a contradiction. So we conclude $d_\epsilon\neq 0$

Now restrict $f$ in $(a,b)$ and consider $\epsilon^*>0$ and $x,y\in (a,b)$ such that $|x-y|<d_{\epsilon^*}$ but $|f(x)-f(y)|>2\epsilon^*$, since {$f_n$$(x)$}$\rightarrow f(x)$ there exists $N_0$ such that $n>N_0\Rightarrow|f_n(x)-f(x)|<\epsilon^*/2$, similarly there exists $M_0$ such that $n>M_0\Rightarrow|f_n(y)-f(y)|<\epsilon^*/2$ hence for $n>max(N_0,M_0)$ $|f(x)-f_n(x)+f_n(x)-f_n(y)+f_n(y)-f(y)|>2\epsilon^*$ $\Rightarrow |f_n(x)-f_n(y)|+|f(x)-f_n(x)|+|f(y)-f_n(y)|>2\epsilon^*$ Therefore $|f_n(x)-f_n(y)|>\epsilon^*$. A contradiction hence there cannot exist $f_n\rightarrow f$ pointwise.

It would be highly appreciated if you could let me know if my proof is correct or point me out any errors I have

Thanks in advance

• what kind of convergence? Commented Apr 15, 2018 at 21:55
• relevant btw: math.stackexchange.com/questions/1593527/… Commented Apr 15, 2018 at 21:56
• also relevant math.stackexchange.com/questions/77307/… Commented Apr 15, 2018 at 21:57
• @KaviRamaMurthy If $f_1,f_2, \dots$ are continuous on $(a,b)$ and converge point wise everywhere there, then the limit function is continuous on a dense $G_\delta$
– zhw.
Commented Apr 20, 2018 at 18:40
• You need uniform convergence for that part. math.stackexchange.com/questions/1133961/… Commented Apr 21, 2018 at 1:27