Baby rudin exercise 2.7 According to Baby rudin exercise 2.7,
When $A_n,n\in N$ is subset of metric space and, If $\cup_{i=1}^\infty A_i=B$ ,then $\cup_{i=1}^\infty \bar{A_i}\subseteq\bar{B}$, $(\bar{a}$ is closure of $a)$.
However, the reverse containment $\bar{B}\subseteq\cup_{i=1}^\infty \bar{A_i}$ does not necessarily hold.
because, let $A_i=\{r_i\},r_i\in \mathbb{Q}$, because rational number is countable $B=\cup_{i=1}^\infty A_i$ can be $\mathbb{Q}$, so $\bar{B}=\mathbb{R}$
but $\cup_{i=1}^\infty \bar{A_i}=\mathbb{Q}$.therefore  $\bar{B}\nsubseteq\cup_{i=1}^\infty \bar{A_i}$ for some case.
Here is my question, I try to prove $\bar{B}\subseteq\cup_{i=1}^\infty \bar{A_i}$ in this way,
$$x\in \bar{B}\Rightarrow x \in B \lor x\in B' $$
$$x\in B\Rightarrow x\in\cup_{i=1}^\infty A_i\subseteq\cup_{i=1}^\infty \bar{A_i}$$
$$x\in B'\Rightarrow \forall r>0,N_r(x)\cap B\neq \emptyset$$
$$\Rightarrow N_r(x)\cap \cup_{i=1}^\infty A_i\neq \emptyset$$
$$\Rightarrow \exists i\in \mathbb{N}\ s.t\ N_r(x)\cap A_i\neq \emptyset $$ 
$$\Rightarrow \exists i\in \mathbb{N}\ s.t\ x\in \bar{A_i}$$
$$\Rightarrow x\in \cup_{n=1}^\infty\bar{A_i}$$
Therefore $\bar{B} \subseteq \cup_{i=1}^\infty \bar{A_i}$
What is problem in my proof?
 A: Why don't we simply see which line is wrong for your counterexample $A_i =\{r_i\}$? Clearly the problem happens between the line $$\exists i\in \mathbb N \; N_r(x)\cap A_i \ne \emptyset$$ and $$\exists i \in \mathbb N\; x\in \overline A_i.$$ 
The problem is that in order to show $x$ is in the closure of $A_i$ we must show every neighborhood of $x$ intersects $A_i.$ You have forgotten to think about how the $\forall r>0$ quantifier carriers down.
We have $$ \forall r >0 \;\exists i\in\mathbb N \;(N_r(x)\cap A_i\ne 0).$$ You would need to change the order of the quantifiers to conclude $\exists i \in \mathbb N\; x\in \overline A_i,$ but that's not allowed.
A: It might be instructive to look at a specific example.
Let $A_n = [0,1-{1 \over n}]$ and $B=[0,1)$. Note that $\cup_n A_n = B$ and the $A_n$ are
closed and $\overline{B} = [0,1]$.
Note that $1$ is not in the closure of any of the $A_n$.
In order to conclude that $x$ is in the closure $A_n$ you need to show that any
neighbourhood of $x$ contains an element of $A_n$, not just one particular neighbourhood.
