It is easy to see that if $A\times B$ is homeomorphic to $A\times C$ for topological spaces $A$, $B$, $C$, then one may not conclude that $B$ and $C$ are homeomorphic (for example, take $C=B^2$, $A=B^{\infty}$). The question is: for which $A$ such conclusion is true? I saw long ago a problem that for $A=[0,1]$ it is not true, but could not solve it, and do not know, where to ask. Hence am asking here. The same question in other categories (say, metric spaces instead topological) also seems to have some sense.

For $A=[0,1]$, let $B$ be the 2torus with one hole and $C$ be the 2disc with two holes. The products $B\times[0,1]$ and $C\times[0,1]$ can be realized in $\mathbb R^3$: the former as a thickening of the torus, the latter in a trivial way. Each of these products is a handlebody bounded by the pretzel surface (the sphere with two handles). It is easy to deform one to the other "by hand". 


In the category of topological spaces, you can't in general even cancel the twopoint discrete space. The only counterexample I know is a bit complicated though: Start with the disjoint union of two copies of the StoneCech compactification $\beta N$ of a countably infinite discrete space N, and glue them together along their remainders (i.e., identify each point p in one copy with the corresponding point in the other copy, except that you don't do this identification when p is in N). The resulting space, which I'll call B to match the notation in the question, has the curious property that, if you add one more isolated point to B, you get a space C that is not homeomorphic to B, but if you add a second isolated point then the result is homeomorphic to B. (The part about adding two isolated points is easy; just apply the successor map on N and its continuous extension on $\beta N$ to everything in sight, to make room for the two extra points  just as in Hilbert's hotel. The part about adding one point is not so easy. I believe it's done (in dual form) in Halmos's "Notes on Boolean Algebras.") Once you have these curious facts about B, it's easy to check that B and C, though not homeomorphic, become homeomorphic when multiplied by a 2point discrete space; the one extra point in C becomes two points, which can be absorbed into one of the copies of B. 


Witold Rosicki has a lot of results of this sort (usually under some conditions on $B$ and $C$). For instance, On decomposition of polyhedra into a Cartesian product of 1dimensional and 2dimensional factors On uniqueness of decomposition of 4polyhedron into Cartesian product of the 2dimensional factors On uniqueness of Cartesian products of surfaces with boundary (with J. Malešič, D. Repovš, A. Zastrow) There also exist papers of a different flavor on this subject All lens spaces have diffeomorphic squares (S. Kwasik, R. Schultz) Noncancellation and a related phenomenon for the lens spaces (A. J. Sieradski) As for nice examples, there exist manifolds $M$ such that $M\times I$ is homeomorphic a ball. For instance, Mazur's 4manifold, as described by Zeeman:
Zeeman also notes a parallel construction of Whitehead's example with surfaces $\times I$ (mentioned above by Sergei Ivanov): `Start with $S^0\times I^2$. In the boundary $S^0 \times S^1$, choose three linked $S^0$'s, each homologous to the first factor', etc. A really cool cancellation theorem is about joins of polyhedra, rather than products (H. Morton):



How about Bing's example: The cartesian product of a certain nonmanifold and a line is $E^4$. The `other' factor is the dogbone decomposition of threespace. 


The question's been studied in the category of groups, too. R. Hirshon proved in [1] that finite groups can always be cancelled in direct products. Hirshon mentions some other sufficient conditions for the cancellation theorem to hold. For instance, he says that in the treatise by L. Fuchs there is a proof of the fact that infinite cyclic abelian groups can also be cancelled (provided that either $B$ or $C$ is a commutative group). References [1] R. Hirshon, On Cancellation in Groups, Amer. Math. Monthly. 76 (9) (1969), pp. 10371039. 


EDIT: This example is faulty, as noted by Ricardo Andrade. This is quite similar to Sergei Ivanovs answer, but my personal favourite example is where you take $A = ]0,1[$, $B = S^1 \times ]0,1[$ and $C$ to be the Moebius strip. Now $B$ and $C$ are not homeomorphic, but both $A \times B$ and $A \times C$ are (homeomorphic to) the solid torus $S^1 \times B(0,1)$. 

