I got a definition :
If I is a nonempty set and for each i in I we have a nonempty sets $ X_i$, then the product of these sets is defined by $$\prod_{i\in I}X_i=\{x:I \rightarrow \bigcup_{i\in I} X_i:x(i)\in X_i\text{ for all } i\ \in I\}$$
The definition is from [https://www.springer.com/gp/book/9783319023670 ]. I think this is not easy to understand it.
Assume we want to prove :
Suppose I is a set, $X_i$ are topological spaces with subsets $A_i$ for $i \in I$. Then, there holds $\operatorname{Clos}\prod_{i\in I}A_i=\prod_{i\in I}\operatorname{Clos} A_i$
Then, the proof $$\prod_{i\in I}\operatorname{Clos} A_i$$ $$=\{x:I \rightarrow \bigcup_{i\in I} \operatorname{Clos} A_i : x(i)\in \operatorname{Clos} A_i\ \text{ for all } i \in I\} $$ $$=\{x:I \rightarrow \operatorname{Clos}(\bigcup_{i\in I} A_i) :x(i)\in \operatorname{Clos} A_i \text{ for all } i \in\ I\}$$ $$=\operatorname{Clos} \prod_{i\in I}A_i$$ is right?
No, closure does not commute with infinite unions as you want to use in the step from line 2 to line 3. The last step is also nonsense, as the closure of a product set depends on the topology we put on the product: it's not a pure set theory fact.
You need to show two inclusions and use the definition of closure and the specific form of open sets in the product topology.
If you have covered nets (generalised sequences) in your course, the following proof does work (modulo some minor details, but in essence):
$x \in \operatorname{Clos} \prod_i A_i$ iff there is some net $(a_n)_{n \in N}$ where all $a_n \in \prod_{i \in I} A_i$ and $a_n \to x$ iff for all $i \in I$ $(a_n)(i) \to x(i)$ iff for all $i \in I$, $x(i) \in \operatorname{Clos} A_i$ iff $x \in \prod_i \operatorname{Clos} A_i$.