When is a topological space $X$ homotopy equivalent to $X\times X$ (with the product topology)?
Clearly if $X$ is contractible this holds, since the product of contractible spaces is contractible. For example, if $X=\mathbb R$ then $X\times X = \mathbb R^2$ and $\mathbb R \simeq \mathbb R^2$.
When $X$ is not contractible, there are obvious counterexamples: Let $X=S^1$, then $X\times X = S^1 \times S^1 \cong T^2$, and obviously $S^1 \not\simeq T^2$.
What are the necessary and sufficient conditions on $X$ for $X \simeq X\times X$ to hold?