Using bijective correspondence between functions from $\mathbb{R} \rightarrow\{0,1\}$ and power set of $\mathbb{R}$. I am having some confusion with the notion of interpreting the topological space $2^\mathbb{R}$ the set of all functions from $\mathbb{R} \rightarrow \{0,1\}$ as equivalent to the set of all subsets of $\mathbb{R}$.The book I am using says to interpret each function as associated with the subset of $\mathbb{R}$ containing the point $a \in \mathbb{R}$ if $f(a)=1$ and not containing $a$ if $f(a)=0$. For some reason I am then interpreting the space $2^ \mathbb{R}$ with the product topology to be equivalent with the discrete topology on $\mathbb{R}$. Is this correct?
For example I am looking at the following question:In the product space $2^\mathbb{R}$, what is the closure of the set $Z$ consisting of all elements of $2^\mathbb{R}$ that are $0$ on every rational coordinate but may be $0$ or $1$ on any irrational coordinate?Equivalently, thinking of $2^\mathbb{R}$ as subsets of $\mathbb{R}$ what is the closure of the set $Z$ consisting of all subsets of $\mathbb{R}$ that do not contain any rational?
An answer that I first came up with was that the closure of $Z$ should be $Z$ itself, because every subset of $\mathbb{R}$ in the discrete topology is closed and therefore equal to its closure. However, I know that the problem is not that trivial. Now that I think about this, is my interpretation the notion that the functions themselves are the elements of the product topology on $2^\mathbb{R}$, not the topological space? Instead should I think about the product topology?
For any point $x$ in $2^\mathbb{R}$ and open set containing $x$, I know that there is a basis element of $2^\mathbb{R}$ with all but finitely many factors equal to $\{0,1\}$ containing $x$.Then should this basis element intersect a point in $Z$, necessarily?
I would appreciate if someone could clear up my confusion on interpreting the set $\mathbb{R}$ as equivalent to $\mathbb{R}$ with the discrete topology, and lead me in the right direction in solving this problem.
 A: In $\{0,1\}^{\Bbb R}$ the reals are just an index set, or the domain for the set of functions. We're not implying or putting any topology on it, we're just discussing the set of all functions on $\Bbb R$ with codomain $\{0,1\}$. If we have such a function $f$  we "identify" it with the subset $A=f^{-1}[\{1\}$ of $\Bbb R$. This way, we've "encoded" all subsets with a unique function and every such function encodes a subset. The set $\{0,1\}$ does have the discrete topology, but then the product topology on $\{0,1\}^{\Bbb R}$ is very far from discrete; it has no isolated points at all.
Let $A \subseteq \{0,1\}^{\Bbb R}$ be all functions such that $f(x)=0$ for all $x \in \Bbb Q$, which indeed corresponds to all subsets of the reals that contain no rational under the aforementioned correspondence.
My claim is that this set is closed: Let $g \notin A$. This means that $g(q)=1$ for some $q \in \Bbb Q$. But then $\pi_q^{-1}[\{1\}]$ is subbasic open in $\{0,1\}^{\Bbb R}$, contains $g$ and is disjoint from $A$, as all members in it by definition also have value $1$ at $q$ (i.e. contain $q$) and so do contain a rational. We can see the basic open sets in this space (when we view them as subsets of $\Bbb R$ as "contain-and-miss" sets: A basic set is of the form (own notation here) $[F;G]:= \{A \subseteq \Bbb R: F \subseteq A; A \cap G = \emptyset\}$ where $F,G \subseteq \Bbb R$ are finite. (In the above proof I used $[\{q\}; \emptyset]$, really). This fits into a more general pattern of other topologies on spaces of subsets (like the Vietoris topology, the Pixley-Roy topology and many others).
