Solution 1:

Let $D=\{0\}$ be the one-point discrete space. Let $f:\mathbb{R}\to\mathbb{R}:x\mapsto x$ be the identity map, and let $g:\mathbb{R}\to D:x\mapsto 0$. Both $f$ and $g$ are easily seen to be closed, but $f\times g:\mathbb{R}^2\to\mathbb{R}\times D$ is not: it maps the graph of $xy=1$, which is a closed set in $\mathbb{R}^2$, to $$\Big(\mathbb{R}\setminus\{0\}\Big)\times\{0\}\;,$$ which is not closed in $\mathbb{R}\times D$: $\langle 0,0\rangle$ is in its closure.

Solution 2:

Perhaps of some interest it might be the following example showing that the product of identical closed maps need not to be closed. Let $f\colon\mathbb{R}\to\mathbb{R}$ be defined by $f(x)=\max\{0,x\}$. Then $f$ is closed since $f[A]$ is either $A$ or $(A\cap[0,\infty))\cup\{0\}$. But $f\times f$ is not, as it maps $\{(x,y)\!:x\cdot y=-1\}$ to $(\{0\}\times(0,\infty))\cup((0,\infty)\times\{0\})$.