I assume you know that for any space $X$ and any subset $C$, $x \in \overline{C}$ iff every open set that contains $x$ intersects $C$. It even suffices to check this for open sets from a certain fixed base of $X$ as well.
I'll do b) first:
Left to right inclusion:
Suppose that $(x,y) \in (A \times B)^d$. As $(A \times B)^d \subset \overline{A \times B} = \overline{A} \times \overline{B}$, $x \in \overline{A}$ and $y \in \overline{B}$.
So suppose that $x \notin A^d$, otherwise $(x,y) \in A^d \times \overline{B}$ and we are done. Then the only way that $x \in \overline{A}$, is that $x$ is an isolated point of $A$, i.e. there exists some open set $U$ such that $\{x\} = U \cap A$. Now let $V$ be any neighbourhood of $y$. Then $U \times V$ is an open neighbourhood of $(x,y)$ that intersects $A \times B$ in some point $(a,b) \neq (x,y)$. But $x = a$ by the previous, so we know that $b \neq y$. In short, every open neighbourhood of $y$ intersects $B$ in a point different from $y$, so $y \in B^d$ and $(x,y) \in \overline{A} \times B^d$.
(Alternatively we could assume $b \notin B^d$, so $y$ is an isolated point of $B$ as well, but then $(x,y)$ is an isolated point of $A \times B$, contradiction.)
Right to left inclusion:
Suppose that $(x,y) \in A^d \times \overline{B}$. Let $U \times V$ be any basic open neighbourhood of $(x,y)$, then $V \cap B \neq \emptyset$, as $y \in \overline{B}$; say it intersects in $b$. Also, there is some $a \neq x$ in $A \cap U$ as $x \in A^d$. Then $(a,b) \neq (x,y)$ by virtue of the first coordinates being different, so $U \times V$ intersects $A \times B$ in a point distinct from $(x,y)$, so $(x,y) \in (A \times B)^d$.
The other part of that inclusion is entirely symmetrical.
As to a):
You're right that $\overline{A} \times \overline{B}$ is closed (and contains $A \times B$ so $\overline{A \times B} \subset \overline{A} \times \overline{B}$.
So suppose $(x,y) \in \overline{A} \times \overline{B}$. Let $(x,y) \in U \times V$, a basic open neighbourhood of it. Then there is some $a \in U \cap A$ and some $b \in V \cap B$, so $(a,b) \in (U \times V) \cap (A \times B)$. As this is true for all basic neighbourhoods of $(x,y)$, we conclude that $(x,y) \in \overline{A \times B}$, as required.
A pair of angles $\theta$ and $\phi$ determine an element $(e^{i\theta},e^{i\phi})$ in $S^1\times S^1$, which in order they can be consider that give a position in the torus.
This is achieved mapping via $(e^{i\theta},e^{i\phi})\longrightarrow\left((2+\cos\theta)\cos\phi,(2+\cos\theta)\sin\phi,\sin\theta\right)$
In the picture, the blue point on the torus is specified by the two angles in green.
![torus](https://i.stack.imgur.com/U0Dlv.png)
Best Answer
A point on a circle $x^2+y^2=r^2$ is defined by an angle $\theta $ via $x=r\cos\theta $ and $y=r\sin\theta $. And it wraps around as $\theta$ goes beyond $2\pi $. A point with angle just under $2\pi $ is close to a point with angle $0$.
A point on the embedded torus $\left (\sqrt {x^2+y^2}-R\right)^2+z^2=r^2 $ is defined by two angles, $\theta $ and $\phi $, via $x=(R+r\cos\theta)\cos\phi $, $y=(R+r\cos\theta)\sin\phi $, $z=r\sin\theta $. And you go around the torus (in two independent directions) as an angles goes beyond $2\pi $.
By the shape of a torus, two points on the torus are close in 3d space when the corresonding pairs of angles $(\theta,\phi) $ for those points are close (an angle just under $2\pi$ being close to $0$). That's why a torus is topologically (rough shape wise) like a product of circles.