I an wondering if there are nonhomeomorphic spaces $X$ and $Y$ such that $X^2$ is homeomorphic to $Y^2$.

3$\begingroup$ This is not an answer to your question, but relates to a linear version of your question, so I mention it as a comment: There exist Banach spaces $X$ and $Y$ such that there exists a linear homeomorphism of $X\oplus X$ onto $Y\oplus Y$, but there is no linear homeomorphism of $X$ onto $Y$. For an example, take $X$ to be the space of Gowers and Maurey (Banach spaces with small spaces of operators, Math. Ann. 307 (1997), no.4, p.543568) with the property that $X$ is linearly homeomorphic to its closed subspaces of even codimension, but not to its closed subspaces of odd codimension. $\endgroup$– Philip BrookerMay 26 '11 at 7:35

1$\begingroup$ mathoverflow.net/questions/26385/… $\endgroup$– Sergey MelikhovMay 26 '11 at 12:20

$\begingroup$ is Moebius^2 homeomorphic to cylinder^2? $\endgroup$– Yaakov BaruchMay 26 '11 at 18:54

2$\begingroup$ Yaakov  no: they are both fibered over the 2torus with fiber a square, so they are topological manifolds with boundary. However, the rational cohomology modulo the boundary is the cohomology of the torus shifted 2 degrees up in one case and zero in the other. $\endgroup$– algoriMay 26 '11 at 19:44

$\begingroup$ ... and in general, there are no counterexamples among 2polyhedra, see the article by Rosicki mentioned below. $\endgroup$– algoriMay 26 '11 at 19:47
Here is an extract from MR0562824 (81d:54005), Trnková, V. Homeomorphisms of products of spaces. (Russian) Uspekhi Mat. Nauk 34 (1979), no. 6(210), 124–138:
S. Ulam raised the following question in 1933: Is there a space $X$ which has nonhomeomorphic square roots, i.e., $X\cong A\times A\cong B\times B$ for some nonhomeomorphic $A,B$? This problem was solved by R. H. Fox in 1947: he constructed two nonhomeomorphic fourdimensional manifolds $A$ and $B$ such that $A\times A\cong B\times B$.
upd: The reference is Fox, R. H. On a problem of S. Ulam concerning Cartesian products. Fund. Math. 34, (1947). 278–287.
The answer to Ulam's question for 3manifolds is positive as well, see Glimm, James Two Cartesian products which are Euclidean spaces. Bull. Soc. Math. France 88 1960 131–135.
The answer for 2polyhedra is negative, see W. Rosicki, "On a problem of S. Ulam concerning Cartesian squares of 2dimensional polyhedra.", Fund. Math. 127 (1987), no. 2, 101–125. This paper also gives the following elementary example:
Take $A$ to be the disjoint union of the Hilbert cube and $\mathbb{N}$ and $B$ to be the disjoint union of two copies of the HIlbert cube and $\mathbb{N}$. Then both $A^2$ and $B^2$ are homeomorphic to the disjoint union of a countable family of Hilbert cubes and $\mathbb{N}$.
Finally, in this example one can replace the Hilbert cube by any space homeomorphic to its square and not homeomorphic to two copies of itself, e.g., by $\left\{1/n\mid n\in\mathbb{Z}_{>0} \right\}\cup\{0\}$.
Yes. Let $M$ be the Whitehead Manifold, which has the property that $M \not\cong \mathbb{R}^3$, but $M\times\mathbb{R}^3 \cong \mathbb{R}^6$. (In fact $M\times\mathbb{R} \cong \mathbb{R}^4$.) Let $$ X \;=\; \mathbb{R}^3 \:\uplus\: M \:\uplus\: M \:\uplus\: M \:\uplus\: M \:\uplus\: \cdots $$ and $$ Y \;=\; \mathbb{R}^3 \:\uplus\: \mathbb{R}^3 \:\uplus\: M \:\uplus\: M \:\uplus\: M \:\uplus\: \cdots\text{,} $$ where $\uplus$ denotes the disjoint union of topological spaces. Then $X$ and $Y$ are not homeomorphic, but $$ X^2 \;\cong\; Y^2 \;\cong\; (\mathbb{R}^6 \:\uplus\: \mathbb{R}^6 \:\uplus\: \cdots) \:\uplus\: (M^2 \:\uplus\: M^2 \:\uplus\: \cdots). $$

$\begingroup$ Can you modify this example so that neither space is homeomorphic to $X \times Y$? $\endgroup$ May 26 '11 at 9:28

3$\begingroup$ Qiaochu  in Jim's example neither space is homeomorphic to $X\times Y$: both $X$ and $Y$ are 3manifolds and so their product is a 6manifold. $\endgroup$– algoriMay 26 '11 at 17:12