Yes, you just need the definition of homeomorphisms to prove the statement. I assume you know this fact 1: Let $S,T$, $S \subset T$ two subset of a topological space $X$, assume that $S$ is connected and $T$ is not connected. If $(U,V)$ is a separation of $T$ then $S \subset U$ or $S \in U$. Here is a proof of the following fact2: Let X and Y two topological spaces, then $X \times Y$ is connected $\Leftrightarrow X,Y$ are connected. $(\Leftarrow)$ suppose that $X,Y$ are connected and $(U,V)$ is a couple of open nonempty sets which unconnect $X \times Y$ which means $X \times Y= U \bigcup V$. Now let $(x_0,y_0) \in U$. The set ${x_0} \times Y$ is connected because it is homeomorphic to $Y$(it is very easy to show!). ${x_0}\times Y$ contains $(x_0,y_0)$ then for fact 1 ${x_0} \times Y \subset U$. On the other hand $\forall y \in Y$, the set $X \times y$ is connected because is homeomorphic to X and contains $(x_0,y) \in U$. Again for fact 1 we can deduct that $X \times y \subset U$. Then $X \times Y= \bigcup_{y \in Y} X \times y \subset U$ $\Rightarrow$ $X \times Y=U$ and $V$ is empty, which is absurd because we supposed that $V$ is nonempty. This contradiction shows that $X \times Y$ can't be unconnected then is connected. $(\Rightarrow)$ Assume that $X \times Y$ is connected, define the canonical projection $\pi: X \times Y \rightarrow X$, $\pi$ is surjective and a continuous map, and for the principal theorem of connection you easily conclude that $X$ is connected. The same reasoning shows that also $Y$ is connected. $\Box$
The principal theorem of connection says that if $X,Y$ are a topological spaces with X connected and $f: X \rightarrow Y$ is a continuous map, then $f(X)$ is connected.