The plane $\mathbb{R}^2$ is $\mathbb{R} \times \mathbb{R}$, and its topology should somehow come from the topology of $\mathbb{R}$. That's what the product topology does, first for two spaces and then for any number of them, even infinitely many. The infinite case has a twist that trips up almost everyone the first time.
Use open "rectangles" as the basis.
Let $X$ and $Y$ be topological spaces. The product topology on $X \times Y$ is the topology having as basis the collection $\mathcal{B}$ of all sets of the form $U \times V$, where $U$ is an open subset of $X$ and $V$ is an open subset of $Y$.
(This $\mathcal{B}$ really is a basis: it covers $X \times Y$, since $X \times Y$ is in it, and $(U_1 \times V_1) \cap (U_2 \times V_2) = (U_1 \cap U_2) \times (V_1 \cap V_2)$ is in it again.) Notice that open sets of $X \times Y$ are unions of rectangles, not just rectangles.
Is the open disk $W = \{(x, y) : (x - 2)^2 + (y - 2)^2 < \frac{9}{4}\}$ open in $\mathbb{R} \times \mathbb{R}$?
Yes, even though it isn't a rectangle. Around each point $p \in W$ at distance $r$ from the boundary circle, the square of half-width $\frac{r}{\sqrt{2}}$ centered at $p$ fits inside $W$, and that square is a product of two open intervals. So $W$ is a union of basis elements.
Drag the point toward the edge and watch the rectangle shrink, then fill the whole disk.
You don't need every open $U$ and $V$. Basis elements of the factors are enough.
Let $(X, \mathcal{T})$ and $(Y, \mathcal{T}')$ be topological spaces. If $\mathcal{B}$ is a basis for $\mathcal{T}$ and $\mathcal{B}'$ is a basis for $\mathcal{T}'$, then the collection $$\tilde{\mathcal{B}} = \{B \times B' : B \in \mathcal{B} \text{ and } B' \in \mathcal{B}'\}$$ is a basis for the topology of $X \times Y$.
Proof. Given an open set $W$ of $X \times Y$ and a point $(x, y) \in W$, by definition of the product topology there is a basis element $U \times V$ with $(x, y) \in U \times V \subset W$. Since $\mathcal{B}$ and $\mathcal{B}'$ are bases, we can choose $B \in \mathcal{B}$ with $x \in B \subset U$ and $B' \in \mathcal{B}'$ with $y \in B' \subset V$. Then $(x, y) \in B \times B' \subset W$. Each $B \times B'$ is open, so by the theorem on recognizing a basis, $\tilde{\mathcal{B}}$ is a basis for $X \times Y$. $\blacksquare$
So the product topology on $\mathbb{R} \times \mathbb{R}$ has the open rectangles $(a, b) \times (c, d)$ as a basis. That's the usual topology of the plane.
On the Subspace Topology page we checked that the product of two subspaces gets the same topology either way you build it. That proof only used this basis of rectangles.
A product comes with two maps that forget one coordinate.
Let $\pi_1: X \times Y \to X$ be defined by $\pi_1(x, y) = x$, and $\pi_2: X \times Y \to Y$ by $\pi_2(x, y) = y$. The maps $\pi_1$ and $\pi_2$ are called the projections of $X \times Y$ onto its first and second factors.
If $U$ is open in $X$, then $\pi_1^{-1}(U) = U \times Y$, a "vertical strip." If $V$ is open in $Y$, then $\pi_2^{-1}(V) = X \times V$, a "horizontal strip." A rectangle is a strip intersected with a strip: $U \times V = \pi_1^{-1}(U) \cap \pi_2^{-1}(V)$. That's the whole content of the next theorem.
The collection $$\mathcal{S} = \{\pi_1^{-1}(U) : U \text{ open in } X\} \cup \{\pi_2^{-1}(V) : V \text{ open in } Y\}$$ is a subbasis for the product topology on $X \times Y$.
Proof. Every element of $\mathcal{S}$ is open in the product topology ($U \times Y$ and $X \times V$ are basis elements), so the topology generated by $\mathcal{S}$ is contained in the product topology. Conversely, every basis element $U \times V = \pi_1^{-1}(U) \cap \pi_2^{-1}(V)$ is a finite intersection of elements of $\mathcal{S}$, so it lies in the topology generated by $\mathcal{S}$, and hence so does every union of such sets. The two topologies are equal. $\blacksquare$
Projections are always continuous (preimages of open sets are strips, which are open), and they are also open maps (Exercise 1). But they are usually not closed maps: the closed set $\{(x, y) : xy = 1\}$ in $\mathbb{R}^2$ projects onto $\mathbb{R} \setminus \{0\}$, which isn't closed.
To take products of infinitely many spaces, we first need to say what an "infinite tuple" is.
Let $J$ be an index set. Given a set $X$, a $J$-tuple of elements of $X$ is a function $x: J \to X$. If $\alpha \in J$, we often denote the value of $x$ at $\alpha$ by $x_\alpha$ and call it the $\alpha$-th coordinate of $x$. We often denote the function $x$ by the symbol $(x_\alpha)_{\alpha \in J}$, which is as close as we can come to "tuple notation" for an arbitrary index set $J$. We denote the set of all $J$-tuples of elements of $X$ by $X^J$.
For a family of spaces $\{X_\alpha\}_{\alpha \in J}$, the product $\prod_{\alpha \in J} X_\alpha$ is the set of $J$-tuples $(x_\alpha)$ with $x_\alpha \in X_\alpha$ for each $\alpha$, and $\pi_\beta: \prod X_\alpha \to X_\beta$, $\pi_\beta((x_\alpha)) = x_\beta$, is the projection onto the $\beta$-th factor.
Same idea as the generalized Cartesian product on the abstract algebra Functions page: an element of a product is a function that picks one point out of each factor.
Now generalize the strips: one subbasis element for each open set in each factor.
Let $\mathcal{S}_\beta$ denote the collection $$\mathcal{S}_\beta = \{\pi_\beta^{-1}(U_\beta) : U_\beta \text{ open in } X_\beta\},$$ and let $\mathcal{S} = \bigcup_{\beta \in J} \mathcal{S}_\beta$. The topology generated by the subbasis $\mathcal{S}$ is called the product topology. In this topology $\prod_{\alpha \in J} X_\alpha$ is called a product space.
Here's the twist. A basis element is a finite intersection of subbasis elements, so it restricts only finitely many coordinates. Basis elements look like $\prod_\alpha U_\alpha$ where each $U_\alpha$ is open in $X_\alpha$ and $U_\alpha = X_\alpha$ for all but finitely many $\alpha$.
There's also a "box topology" where every coordinate gets restricted at once. It looks more natural and behaves so badly that topologists mostly keep it around to show what goes wrong.
The product $\mathbb{R}^\omega = \mathbb{R} \times \mathbb{R} \times \cdots$ (sequences of real numbers) is the place to see this. Drag $N$, and drag the coordinates of $x$.
That picture is Exercise 3 below. Next, the product topology plays well with everything else: subspaces, the Hausdorff property, closures, and continuity.
Let $A_\alpha$ be a subspace of $X_\alpha$, for each $\alpha \in J$. Then $\prod A_\alpha$ is a subspace of $\prod X_\alpha$ if both products are given the product topology.
Proof. A subbasis element of $\prod A_\alpha$ has the form $\{(a_\alpha) : a_\beta \in U_\beta \cap A_\beta\}$ with $U_\beta$ open in $X_\beta$, which is exactly $\pi_\beta^{-1}(U_\beta) \cap \prod A_\alpha$. So the subbasis of the product topology on $\prod A_\alpha$ is the subbasis of $\prod X_\alpha$ intersected with $\prod A_\alpha$. Taking finite intersections and unions commutes with intersecting with $\prod A_\alpha$, so the two topologies on $\prod A_\alpha$ agree. $\blacksquare$
If $X_\alpha$ is a Hausdorff space for each $\alpha$, then $\prod_{\alpha \in J} X_\alpha$ is a Hausdorff space in the product topology.
Proof. Let $x, y \in \prod X_\alpha$ be distinct. Then there is $\beta \in J$ with $x_\beta \neq y_\beta$. Since $X_\beta$ is Hausdorff, there are disjoint neighborhoods $U_\beta$ and $V_\beta$ of $x_\beta$ and $y_\beta$. Then $\pi_\beta^{-1}(U_\beta)$ and $\pi_\beta^{-1}(V_\beta)$ are open in $\prod X_\alpha$, contain $x$ and $y$, and are disjoint (a common point would have its $\beta$-th coordinate in $U_\beta \cap V_\beta$). So the product is Hausdorff. $\blacksquare$
Let $\{X_\alpha\}$ be an indexed family of spaces and let $A_\alpha \subset X_\alpha$ for each $\alpha$. If $\prod X_\alpha$ is given the product topology, then $$\prod \overline{A_\alpha} = \overline{\prod A_\alpha}.$$
Proof. Let $x = (x_\alpha)$ be a point of $\prod \overline{A_\alpha}$, and let $B = \prod B_\alpha$ be a basis element containing $x$. For each $\alpha$, $x_\alpha \in \overline{A_\alpha}$ and $B_\alpha$ is a neighborhood of $x_\alpha$, so we can choose $y_\alpha \in B_\alpha \cap A_\alpha$. Then $y = (y_\alpha)$ lies in both $B$ and $\prod A_\alpha$. Since $B$ was arbitrary, $x \in \overline{\prod A_\alpha}$.
Conversely, let $x = (x_\alpha) \in \overline{\prod A_\alpha}$. Fix $\beta$, and let $V_\beta$ be any open set of $X_\beta$ containing $x_\beta$. Since $\pi_\beta^{-1}(V_\beta)$ is open in $\prod X_\alpha$ and contains $x$, it contains a point $z = (z_\alpha)$ of $\prod A_\alpha$. Then $z_\beta \in V_\beta \cap A_\beta$. So every neighborhood of $x_\beta$ meets $A_\beta$, and $x_\beta \in \overline{A_\beta}$. This holds for every $\beta$, so $x \in \prod \overline{A_\alpha}$. $\blacksquare$
The last theorem is the most useful one: continuity into a product is checked one coordinate at a time.
Let $f: A \to \prod_{\alpha \in J} X_\alpha$ be given by $f(a) = (f_\alpha(a))_{\alpha \in J}$, where $f_\alpha: A \to X_\alpha$ for each $\alpha$. Let $\prod X_\alpha$ have the product topology. Then $f$ is continuous if and only if each function $f_\alpha$ is continuous.
Proof. Let $\pi_\beta$ be the projection onto the $\beta$-th factor. It is continuous: if $U_\beta$ is open in $X_\beta$, then $\pi_\beta^{-1}(U_\beta)$ is a subbasis element, hence open. Now suppose $f$ is continuous. Then $f_\beta = \pi_\beta \circ f$ is a composition of continuous functions, so it is continuous.
Conversely, suppose every $f_\alpha$ is continuous. It is enough to check that preimages of subbasis elements are open, because preimages commute with unions and finite intersections. A typical subbasis element is $\pi_\beta^{-1}(U_\beta)$ with $U_\beta$ open in $X_\beta$, and since $f_\beta = \pi_\beta \circ f$, $$f^{-1}(\pi_\beta^{-1}(U_\beta)) = f_\beta^{-1}(U_\beta),$$ which is open in $A$ because $f_\beta$ is continuous. $\blacksquare$
Is $f: \mathbb{R} \to \mathbb{R}^\omega$, $f(t) = (t, t, t, \dots)$ continuous in the product topology?
Yes. Every coordinate function is $f_n(t) = t$, which is continuous, so $f$ is continuous by the theorem. (In the box topology this same $f$ is not continuous; the preimage of $\prod_n (-\frac{1}{n}, \frac{1}{n})$ would be $\{0\}$. This is one of the reasons the product topology is the "right" one.)
Two definitions for the exercises.
A map $f: X \to Y$ is said to be an open map if for every open set $U \subset X$, the set $f(U)$ is open in $Y$.
And the most important infinite product.
The set $\mathbb{R}^\omega$ is the countably infinite product of $\mathbb{R}$ with itself: $$\mathbb{R}^\omega = \prod_{n \in \mathbb{N}} X_n, \quad \text{where } X_n = \mathbb{R} \text{ for each } n.$$
Start with the projections.
Show that $\pi_1: X \times Y \to X$ and $\pi_2: X \times Y \to Y$ are both open maps.
Proof. Let $U$ be open in $X \times Y$. Then $U$ is a union of basis elements: $$U = \bigcup_{\alpha \in J} V_\alpha \times W_\alpha,$$ where each $V_\alpha$ is open in $X$ and each $W_\alpha$ is open in $Y$. We may drop any empty $V_\alpha \times W_\alpha$, so assume each $V_\alpha$ and $W_\alpha$ is nonempty. Then $$\pi_1(U) = \bigcup_{\alpha \in J} V_\alpha \quad \text{and} \quad \pi_2(U) = \bigcup_{\alpha \in J} W_\alpha.$$ Each is a union of open sets, so it is open. Hence $\pi_1$ and $\pi_2$ are open maps. $\blacksquare$
Next, a countable basis for the plane.
Show that the countable collection $$\mathcal{B} = \{(a, b) \times (c, d) : a < b, \; c < d, \; a, b, c, d \in \mathbb{Q}\}$$ is a basis for $\mathbb{R} \times \mathbb{R}$.
Proof. Each element of $\mathcal{B}$ is open. Let $U \subset \mathbb{R} \times \mathbb{R}$ be open and $(x, y) \in U$. There is a basis rectangle around $(x, y)$ inside $U$, so there are $\delta, \varepsilon > 0$ with $$(x, y) \in (x - \delta, x + \delta) \times (y - \varepsilon, y + \varepsilon) \subset U.$$ By density of $\mathbb{Q}$ in $\mathbb{R}$, choose rationals $r_1 \in (x - \delta, x)$, $r_2 \in (x, x + \delta)$, $r_3 \in (y - \varepsilon, y)$, and $r_4 \in (y, y + \varepsilon)$. Then $B = (r_1, r_2) \times (r_3, r_4) \in \mathcal{B}$ and $(x, y) \in B \subset U$. By the theorem on recognizing a basis, $\mathcal{B}$ is a basis for $\mathbb{R} \times \mathbb{R}$. $\blacksquare$
The widget above, as a proof.
Let $\mathbb{R}^\infty$ be the subset of $\mathbb{R}^\omega$ consisting of all sequences that are "eventually zero," that is, all sequences $(x_1, x_2, \dots)$ such that $x_i \neq 0$ for only finitely many $i$. What is the closure of $\mathbb{R}^\infty$ in $\mathbb{R}^\omega$ in the product topology?
$\overline{\mathbb{R}^\infty} = \mathbb{R}^\omega$. Let $x = (x_n)$ be any point of $\mathbb{R}^\omega$, and let $V_1 \times V_2 \times \cdots$ be a basis element containing $x$, where each $V_k$ is open in $\mathbb{R}$ and, for some $N$, $V_k = \mathbb{R}$ for all $k \ge N$. Let $y = (x_1, x_2, \dots, x_{N-1}, 0, 0, \dots)$ be the truncated sequence. Then $y \in \mathbb{R}^\infty$ and $y \in V_1 \times V_2 \times \cdots$. Every basis element around $x$ meets $\mathbb{R}^\infty$, so $x \in \overline{\mathbb{R}^\infty}$. Hence $\mathbb{R}^\infty$ is dense in $\mathbb{R}^\omega$.
The proof breaks down completely if basis elements could restrict every coordinate.
Whenever you work with a basis element of an infinite product, say out loud: "there is an $N$ such that $V_k = X_k$ for all $k \ge N$." Almost every proof about infinite products uses that sentence, and forgetting it is the most common mistake.
A prelim problem about an infinite product of finite discrete spaces.
For each $n \in \mathbb{N}$, let $X_n = \{1, 2, \dots, n\}$ with the discrete topology, and let $$X = \prod_{n=1}^{\infty} X_n$$ have the product topology. Let $k \in \mathbb{N}$, and let $A_k$ be the set of elements $(x_i)_{i=1}^\infty \in X$ such that $x_i$ is a positive integer multiple of $k$ for all $i \ge k$. Show that $A_k$ is a closed subset of $X$.
First, get a feel for $X$: it is the space of all sequences of positive integers whose $n$-th term is at most $n$. For example $(1, 2, 3, 4, 5, \dots)$, $(1, 2, 1, 4, 1, 6, \dots)$, and $(1, 2, 3, 3, 3, \dots)$ are in $X$. The set $A_3$ contains sequences like $(1, 2, 3, 3, 3, 6, 6, 6, 9, \dots)$ and $(1, 1, 3, 3, 3, 6, 3, 6, 3, \dots)$: from the third term on, every term is a multiple of $3$.
Proof. We show $X \setminus A_k$ is open. Let $p = (p_i) \in X \setminus A_k$. Then there is some $j \ge k$ such that $p_j$ is not a multiple of $k$. Since $X_j$ has the discrete topology, $\{p_j\}$ is open in $X_j$, so $$U = \pi_j^{-1}(\{p_j\}) = X_1 \times \cdots \times X_{j-1} \times \{p_j\} \times X_{j+1} \times \cdots$$ is open in $X$ (it restricts only one coordinate). Every sequence in $U$ has $j$-th term $p_j$, which is not a multiple of $k$, so $U \subset X \setminus A_k$. And $p \in U$. So every point of $X \setminus A_k$ has a neighborhood inside $X \setminus A_k$; it is open, and $A_k$ is closed. $\blacksquare$