# if two space are homotopy equivalent and one is connected, prove that the other is connected as well

I've tried using the definition of homotopy equivalent spaces which states that X and Y are homotopy equivalent if:

There are continuous functions $f:X \rightarrow Y,g:Y \rightarrow X$ such that $f \circ g$ is homotopic to the identity map of Y and $g \circ f$ is homotopic to the identity map of X.

I don't see how this definition can help us. I know that X and Y have the same fundamental groups as well, can that help me?

Kees

Let $X$ be connected. Write $Y=U\cup V$ as disjoint union of open sets. Then $X=f^{-1}(U)\cup f^{-1}(V)$ is also a disjoint union of open sets. As $X$ is connected this implies that one of them is empty, say $f^{-1}(U)=\emptyset$. Then $f\circ g$ maps $Y$ into $V$. Via a homotopy to $\operatorname{id}Y$ we find for any $y\in Y$ a path from $f(g(y))\in V$ to $y$. It follows that $y$ cannot be in $U$, that is: $U=\emptyset$. We conclude that $Y$ is connected.
A rephrasing of the argument: let $X$ be connected and let $\alpha: Y\to \{0,1\}$ be continuous. Then, the composition $X\to Y \to \{0,1\}$ is constant, and the composition $Y\to X\to Y \to \{0,1\}$ is homotopic to $\alpha$. Since the composition is constant, and the homotopy can not leave a path component, $\alpha$ is constant.