Question: $A,B,C$ are groups and we know $A\times B\simeq A\times C$. Is $B$ isomorphic to $C$?

My work:

(1) If $A,B,C$ are finite Abel groups, then this proposition is true, because we just need to compare the invariant factors on both sides.

(2) If $A,B,C$ are infinite groups, I constructed a counter-example in which $A$ is direct product of countable