Proof that a sequence of continuous functions $(f_n)$ cannot converge pointwise to $1_\mathbb{Q}$ on $[0,1]$ As a homework question, we got asked the following:

Construct a function $f:[0,1] \rightarrow \mathbb{R}$ which is not the pointwise limit of any sequence of continuous functions

Thinking about it, a function which is nowhere continuous should be sufficient; thus I decided to try to use the indicator function on the rationals, $1_\mathbb{Q}$. Basically, I was just wondering if my proof was alright or not:
Suppose $(f_n)$ is a sequence of continuous functions converging pointwise to $1_\mathbb{Q}$; thus for any $\epsilon > 0$ we have that for all $x$ we can find a $N$ such that if $n \geq N$ then $| f_n(x) - 1_\mathbb{Q} (x) | < \epsilon$. In particular, we have for some $x_1 \in \mathbb{Q}, x_2 \notin \mathbb{Q}$ a $N_1$ and $ N_2$ respectively such that


*

*if $ n \geq N_1$ then $ | f_n(x_1) - 1 | < \epsilon$

*if $ n \geq N_2$ then $ | f_n(x_2) | < \epsilon$


Now, as $f_k$ is continuous, for any $\epsilon > 0$ we have that for all $x$ there exists a $\delta > 0$ such that if $ | x- y | < \delta$ then $|f_k(x) - f_k(y) | < \epsilon $. However, if we pick an arbitrary $x \in \mathbb{Q}$, for $n \geq \max\{N_1, N_2\}$, for any $\delta > 0$ we can pick a $ y \notin \mathbb{Q}$ such that $| x- y| < \delta$ yet $ | f_n(x) - f_n(y) - 1|  < 2\epsilon$ (by the triangle inequality and using the pointwise convergence properties); so if we choose $\epsilon = 1/10$, say, then we have by continuity that $|f_n(x) - f_n(y)| < 1/10$, yet $| f_n(x) - f_n(y) - 1|  < 1/5$, which (I believe) is absurd, so we have a contradiction.
I'm a bit iffy about whether this is alright or not (I feel I may be subtly abusing the definitions here), so any feedback would be much appreciated.
 A: Here is a rather elementary proof. First we will need a lemma:
Lemma For all non-empty segment $S \subseteq [0,1]$, there exists an arbitrarily large $N$ and a non-empty segment $S' \subseteq S$ such that $f_N(S') = [\frac 1 4, \frac 3 4]$.
Proof: let $S$ such a segment, we can find $x$ and $y$ in $S$ such that $x$ is rational, $y$ is irrational and $x < y$. Since $(f_n)$ converges pointwise to $1_{\mathbb Q}$, there exists an arbitrarily large $N$ such that $f_N(x) \geq \frac 3 4, f_N(y) \leq \frac 1 4$. By the intermediate value theorem, there exists a non-empty segment $S' \subseteq[x,y] \subseteq S$ such that $f_N(S') = [\frac 1 4, \frac 3 4]$.
Using this fact, we can build a subsequence $f_{\phi(n)}$ and a non-increasing sequence of non-empty segments $(S_n)$ such that $f_{\phi(n)}(S_n) = [\frac 1 4, \frac 3 4]$. Using compactness, $\bigcap_{n} S_n \neq \emptyset$: let $x \in \bigcap_{n} S_n$. We have $f(x) = \lim_{n \to \infty} f_{\phi(n)}(x) \in [\frac 1 4, \frac 3 4]$, a contradiction.
