proving continuity For each n belongs to natural numbers let,
$$f_n(x) =
\begin{cases}
0,  & x \in  \mathbb{Q} \cap[-1,-1/n] \cup [1/n,1] \\
1, & x \in  \mathbb{Q}^c\cap[-1,-1/n] \cup [1/n,1]  \\
0,  &  x \in (-1/n,1/n) \\
\end{cases}
$$
Prove that for each $n \in \mathbb{N}$ $f_n$ is continuous at 0. Find $\lim\limits_{ n\to \infty} f_n(x)$ for each $x \in (-1,1)$. Let $f(x)=\lim\limits_{ n\to \infty} f_n(x)$ for each $x \in (-1,1)$. Is $f$ continuous at $0$? Justify your answer?
I proved that  $f_n(x)$is continuous at 0by epsilon delta definition.Then
$\lim\limits_{ n\to \infty} $$f_n(x)$  =
\begin{cases}
0,  & \text{, x $\in $ Q$\cap$[-1,-1/n] $\cup$ [1/n,1]} \\
1, & \text{,x $\in $ Q$^c$$\cap$[-1,-1/n] $\cup$ [1/n,1)}]  \\
0,  & \text{, x $\in $(-1/n,1/n)} \\
\end{cases}
This is equl to
$\lim\limits_{ n\to \infty} $$f_n(x)$ =
\begin{cases}
0,  & \text{, x $\in $ Q$\cap$[-1,-1] } \\
1, & \text{,x $\in $ Q$^c$$\cap$[-1,1}]  \\
 \\
\end{cases}
But I am not sure of the  $\mathbf ranges$  of this.
When limit is 1 I am not sure if the range can be written as  x $\in $ Q$^c$$\cap$[-1,1}.Should it be x $\in $ Q$^c$$\cap$[-1,-1/n] $\cup$ [1/n,1)}?
And how to show f is continuous at 0?
 A: Your answer is wrong, assuming you haven't mis-typed it.
$f_n$ is defined as equal to the Dirichlet function on $[-1,1]$, except on a small neighborhood of $0$ $(-1/n,1/n)$, where it is constant and equal to $0$. Since that open interval will shrink to the single point $0$ when $n\rightarrow\infty$, $f(x)$ is simply equal to the Dirichlet function everywhere on $[-1,1]$ except $0$, where $f(x) = 0$. But $0$ is rational, so the Dirichlet function is equal to $0$ at $0$, anyway. So actually, we have simply:
$$\lim_{n\rightarrow\infty}f_n(x)=f(x)=
                                   \begin{cases}
                                      0, x\in\Bbb Q\cap[-1,1]\\\\1, x\in\Bbb Q^c\cap[-1,1]
                                   \end{cases}$$
Showing that the Dirichlet function is continuous at $0$ is not so difficult.
Your question as to the range shows some confusion: it would meaningless to use the expression $x\in\Bbb Q^c\cap([-1/,-1/n]\cup[1/n,1])$ or anything like it in the expression for the limit of $f_n$. You can not use $n$ in the expression for the limit of something as $n\rightarrow\infty$, because what is $n$ equal to then? It's not a fixed variable, it's simply something that is being made to "tend towards" infinity.
