The basic fact we use is the one you start out with (which I won't prove, as I assume it's already known; it's not hard anyway):
(1) $X$ is connected iff every continuous function $f: X \rightarrow \{0,1\}$ (the latter space in the discrete topology) is constant.
So, given connected spaces $X$ and $Y$, we start with an arbitrary continuous function $F: X \times Y \rightarrow \{0,1\}$ and we want to show it is constant. This will show that $X \times Y$ is connected by (1).
First, for a fixed $x \in X$, we can define $F_x: Y \rightarrow \{0,1\}$ by $F_x(y) = F(x,y)$.
This is the composition of the maps that sends $y$ to $(x,y)$ (for this fixed $x$) and $F$, and as both these maps are continuous, so is $F_x$, for every $x$. So, as this is a continuous function from $Y$ to $\{0,1\}$ and $Y$ is connected, every $F_x$ is constant, say all its values are $c_x \in \{0,1\}$.
Of course we haven't used the connectedness of $X$ yet, so we do the exact same thing fixing $y$: for every $y \in Y$, we define $F^y: X \rightarrow \{0,1\}$ by $F^y(x) = F(x,y)$. Again, this is a composition of the map sending $x$ to $(x,y)$ (for this fixed $y$) and $F$, so every $F^y$ is continuous from the connected $X$ to $\{0,1\}$ and so $F^y$ is constant with value $c'_y \in \{0,1\}$, say.
The claim now is that $F$ is constant: let $(a,b)$ and ($c,d)$ be any two points in $X \times Y$. Then we also consider the point $(a,d)$ and note that:
$$F(a,b) = F_a(b) = c_a = F_a(d) = F(a,d) = F^d(a) = c'_d = F^d(c) = F(c,d)\mbox{,}$$
first using that $F_a$ is constant and then that $F^d$ is constant. We basically connect any 2 points via a third using a horizontal and a vertical "line" (here via $(a,d)$) and on every "line" $F$ remains constant, so $F$ is a constant function. This concludes the proof.
As a last note: the fact that a function $x \rightarrow (x,y)$, for fixed $y$, is continuous, is easy from the definitions: a basic neighbourhood of $(x,y)$ is of the form $U \times V$, $U$ open in $X$ containing $x$, $V$ open in $Y$ containing $y$, and its inverse image under this function is just $U$.