The product of continuous function is continuous.

Here's a proof by abstract nonsense:

Consider the compositions $\phi\circ\pi_A:A\times B\to C$ and $\psi\circ \pi_B:A\times B\to D$. These are continuous, so by the universal property of $C\times D$ we have a unique continuous map $\Gamma:A\times B\to C\times D$ making the obvious diagram commute, i.e. satisfying $\pi_C\circ \Gamma=\phi\circ \pi_A$ and $\pi_D\circ \Gamma=\psi\circ \pi_B$. Since we also have $\pi_C\circ \Delta=\phi\circ \pi_A$ and $\pi_D\circ \Delta=\psi\circ \pi_B$, it follows that $\Delta=\Gamma$. Therefore, $\Delta$ is continuous.


My answer here formulates the universal property of products as follows:

| If $f: X \to \prod_{i \in I} X_i$ is a function into a product, then $f$ is continuous iff $\forall i \in I: \pi_i \circ f: X \to X_i$ is continuous.

Here we have $\Delta: A \times B \to C \times D$ and $\pi_C \circ \Delta = f \circ \pi_A$ which is a continuous map as a composition of the continuous $\pi_A$ and $f$. Similarly, $\pi_D \times \Delta = g \circ \pi_B$ is continuous, and so $\Delta$ is continuous. Your own answer overcomplicates things: it's a straightforward application of the aforementioned universal mapping principle applied to $X_1 \times X_2 = C \times D$ (and also $X=A \times B$, but that product structure is irrelevant, except I need the continuous projections on it).

I don't see the added value of using a pure category-theoretical approach here either, BTW.

The map $\Delta$ is usually called $\prod_i f_i$ in general or $f \times g$ in this case. I think it's clearer. I use $\nabla_i f_i: X \to \prod_i X_i$ for a situation where I have maps $X \to X_i$ for all $i$ (so common domain) and we define $(\nabla_i f_i)(x)=(f_i(x))_i$ etc.), which is commonly called the diagonal product of the $f_i$. The $\Delta$ is "just" the categorical product of the maps.


Definition

If $X$ is a topological space and if $\mathfrak{Y}=\{Y_j:j\in J\}$ is a collection of topological spaces and if $\mathfrak{F}=\{f_j:X\rightarrow Y_j:j\in J\}$ is a collection of functions then the diagonal product $\Delta_{_{\mathfrak{F}}}:X\rightarrow\prod_{j\in J}Y_j$ is a function defined through the condition $$ 1.\quad\big[\Delta_{_{\mathfrak{F}}}(x)\big](j)=f_j(x) $$ for any $x\in X$ and for any $j\in J$.

Lemma

Each function of $\mathfrak{F}$ is continuous if and only if $\Delta_{_{\mathfrak{F}}}$ is continuous.

Proof. By the condition $1$ we observe that for any $j\in J$ if $\pi_j$ is the projection $j$-th projection of $\prod_{j\in J}Y_j$ then $$ \pi_j\circ\Delta_{_{\mathfrak{F}}}=f_j $$ so that the lemma follows directely by the universal mapping theorem for products.

Now if $\mathfrak{X}=\{X_j:j\in J\}$ and $\mathfrak{Y}=\{Y_j:j\in J\}$ are a collections of topological spaces and if $\Phi=\{\phi_j: X_j\rightarrow Y_j\}$ is a collection of functions then for any $j\in J$ we define $$ f_j:=\phi_j\circ\overline{\pi_j} $$ where $\overline{\pi_j}$ is the $j$-th projection of $\prod_{j\in J}X_j$ and so we even define $$ X:=\prod_{j\in J}X_j $$ and $$ \mathfrak{F}:=\{f_j:j\in J\} $$ so that $$ \underline{\pi_j}\circ\Delta_{_{\mathfrak{F}}}=f_j=\phi_j\circ\overline{\pi_j} $$ where $\underline{\pi}_j$ is the $j$-th projection in $\prod_{j\in J}Y_j$.

So in the case where $J=\{1,2\}$ it is easy to verfy that $\Delta_{_\mathfrak{F}}$ is equal to the function above defined in the question.