$\mathscr{B}$ is a uniformly closed algebra The following theorem is from PMA Rudin. I understand that $\mathscr{B}$ is an algebra. But Rudin links to theorem 2.27 for uniformly closed and I can't understand how he uses it and I prove this result by myself.
Let $\mathscr{B}$ be the uniform closure of an algebra $\mathscr{A}$of bounded functions. Then $\mathscr{B}$ is a uniformly closed algebra.
Proof: We have to prove that $\mathscr{B}$ is uniformly closed. 
Let $\{f_n\} \in \mathscr{B}$ with $f_n\to f$ uniformly on $E$. Then for any $n\in \mathbb{N}$ exists $\{f_{n,k}\} \in \mathscr{A}$ such that $f_{n,k}\to f_n$ uniformly on $E$. It's easy to check that for any $n\in \mathbb{N}$ $\exists g_n\in \mathscr{A}$ such that $|g_n(x)-f_n(x)|<\frac{1}{n}$ for any $x\in E$. We prove that $g_n \to f$ uniformly on $E$.
Let $\epsilon >0$ be given. 1)Then $\exists N_1$ such that $n\ge N_1$ implies $|f_n(x)-f(x)|<\epsilon$ for any $x\in E$.
Taking $N_2=\max \{N_1, \left[\frac{1}{\epsilon}\right]+1\}$ then for $n\ge N_2$ we have $$|g_n(x)-f(x)|\leqslant |g_n(x)-f_n(x)|+|f_n(x)-f(x)|<\frac{1}{n}+\epsilon<2\epsilon.$$
Is my proof correct?
By the way can anyone explain how Rudin uses theorem 2.27 please?
I would be grateful for your help!
 A: Your proof is correct. Let me just point out how Theorem 2.27 is used. 

Theorem 2.27 (a) in Rudin: If $X$ is a metric space and $E \subset X$, then $\overline E$ is closed.

To use this, let $X$ be the set of all bounded functions $f: S \to \mathbb R$. The uniform metric $d_\infty$ on $X$ is given by 
$$d_\infty (f, g) = \sup_{s\in S} |f(s) - g(s)|.$$
It is easy to check that $d_\infty$ is a metric on $X$. Let $\mathscr{A}$ be a subset of $X$. Then the uniform closure $\mathscr B$ is just $\overline{\mathscr{A}}$, thus Theorem 2.27 (a) says that $\mathscr B$ is uniformly closed. 
On the other hand, your proof above actually shows that $\overline{\overline E} = \overline E$ for $E\subset X$. 
Remark: We show that $\mathscr B = \overline{\mathscr A}$. Firstly, let $f\in \mathscr B$. Then by definition, there is $f_n \in \mathscr A$ so that $f_n$ converges uniformly to $f$ on $S$. That is, for all $\epsilon >0$ there is $N\in \mathbb N$ so that 
$$|f_n(x) - f(x)| <\epsilon$$
for all $x\in S$ and $n\ge N$. The above inequality implies that 
$$d_\infty (f_n, f) = \sup_{x\in S} |f_n(x) - f(x)| \le \epsilon$$
for all $n\ge N$. So $f_n \to f$ in $(X, d_\infty)$ and so $f\in \overline{\mathscr A}$. Doing the reverse direction, one sees that $\overline{\mathscr A} \subset \mathscr B$. 
