In $\mathbb{R}^{\mathbb{R}}$, $E=\{f\in \mathbb{R}^{\mathbb{R}}: f(x)=0$ or $1, f(x)=0 $ only finitely often$\}$
Let g be a function in $\mathbb{R}^{\mathbb{R}}$, and g is identically $0$, then in the product topology of $\mathbb{R}^{\mathbb{R}}$, $g\in Cl(E)$.
How do I find a net $f_n$ converges to g?
I constructed a neighborhood base of g, define a relation on it, and show that it is a directed set, what should I do next?
Thanks for any help!
I’ve a feeling that you may be letting the details get in the way of the basic idea, because once you’ve constructed a base $\mathscr{B}$ at $g$ and shown that $\langle\mathscr{B},\supseteq\rangle$ is a directed set, there’s only one reasonable thing to do. If $g$ really is in the closure of $E$, then it must be true that $B\cap E\ne\varnothing$ for each $B\in\mathscr{B}$, so for each $B\in\mathscr{B}$ we should be able to choose an $f_B\in B\cap E$.
Suppose that we can; then $\nu=\langle f_B:B\in\mathscr{B}\rangle$ is certainly a net in $E$. Does it converge to $g$? Let $U$ be any open nbhd of $g$; there is some $B_0\in\mathscr{B}$ such that $B_0\subseteq U$. If $B\in\mathscr{B}$, and $B_0\supseteq B$, then $$f_B\in B\cap E\subseteq B_0\subseteq U\;,$$ so the net $\nu$ is eventually in $U$: $f_B\in U$ for each $B\in\mathscr{B}$ with $B_0\supseteq B$. And $U$ was an arbitrary open nbhd of $g$, so $\nu$ converges to $g$, as desired. Thus, it only remains to show that $B\cap E\ne\varnothing$ for each $B\in\mathscr{B}$.
Assuming that you picked a natural local base at $g$, this is very easy. For instance, you might use the following local base. For each non-empty finite $F\subseteq\Bbb R$ and each real number $r>0$ let
$$B(F,r)=\left\{f\in\Bbb R^{\Bbb R}:|f(x)|<r\text{ for each }x\in F\right\}\;,$$
and let
$$\mathscr{B}=\left\{B(F,r):F\subseteq\Bbb R\text{ is finite and non-empty and }0<r\in\Bbb R\right\}\;.$$
It follows from the definition of the product topology that this $\mathscr{B}$ is a local base at $g$, and that automatically makes $\langle\mathscr{B},\supseteq\rangle$ a directed set: for any $B_0,B_1\in\mathscr{B}$ there is a $B_2\in\mathscr{B}$ such that $B_2\subseteq B_0\cap B_1$, i.e., such that $B_0\supseteq B_2$ and $B_1\supseteq B_2$, and $B_2$ is therefore an upper bound for $\{B_0,B_1\}$ in $\langle\mathscr{B},\supseteq\rangle$.
And now it’s easy to pick an $f_B\in B\cap E$ for each $B\in\mathscr{B}$: if $B=B(F,r)$, let
$$f_B:\Bbb R\to\Bbb R:x\mapsto\begin{cases} 0,&\text{if }x\in F\\ 1,&\text{if }x\in\Bbb R\setminus F\;. \end{cases}$$
Clearly $f_B\in B(F,r)\cap E$.
The only part of the argument that depends on the specific example is choosing the local base $\mathscr{B}$ at $g$ in such a way that we can easily find an $f_B\in B\cap E$ for each $B\in\mathscr{B}$; everything else falls out automatically from the fact that $\mathscr{B}$ is a local base at $g$.