Show that $(X\times Y)\setminus (A\times B)$ is connected 
Problem.
Let $\emptyset \subset A\subset X$ and $\emptyset \subset B\subset Y$. If $X$ and $Y$ are connected, show that $(X\times Y)\setminus (A\times B)$ is also connected by using the criteria of connectedness that if for any continuous function $f$ such that $f:X\to \{\pm1\}$, $f$ is constant then $X$ is connected.

I began by assuming that there exists a function $f:(X\times Y)\setminus (A\times B)\to\{\pm1\}$ which is continuous but not constant but couldn't proceed any further beyond that.

Let $p:X\times Y\rightarrow (X\times Y)/(A\times B)$ be the quotient map; it is surjective. Consider a continuous function $f:(X\times Y)/ (A\times B)\to\{\pm1\}$. $f\circ p$ is continuous; since $X\times Y$ is connected, $f\circ p$ is constant. Since $p$ is surjective, $f$ is constant.
