Solution (source code)

= Solution

The <product topology> is generated by the <basis of a topology> of open rectangles $U\times V$, with $U$ open in $X$ and $V$ open in $Y$. For a fixed $y$,
$$
 i_y^{-1}(U\times V)=\begin{cases}U,&y\in V,\\\varnothing,&y\notin V.\end{cases}
$$
Both possibilities are open; checking this <basis of a topology> proves that $i_y$ is <continuous>. The analogous map $j_x:Y\to X\times Y$, $j_x(y)=(x,y)$, is <continuous> by the same argument.

If either factor is empty the product is empty and <connected>. Otherwise let $h:X\times Y\to\{0,1\}$ be <continuous>. For each $y$, $h\circ i_y$ is constant since $X$ is <connected>. Thus $h(x,y)=h(x_0,y)$ for any fixed $x_0\in X$. The right-hand side is $h\circ j_{x_0}$ and is constant in $y$ since $Y$ is <connected>. Therefore $h$ is constant on the whole product. The given characterization proves \b[$X\times Y$ is <connected>].