To introduce some symbolism for clarity's sake, here is the problem I'm faced with in an assignment:
Find an example of four groups $A,B,C,D$ such that $$A \times B \cong C \times D$$ but at the same time neither of $A,B$ are isomorphic to either of $C,D$.
I feel like I touched on a possible means of solving this, but I'm not sure it's sufficient/correct, and even if it is constructing the isomorphism is proving ... not too easy.
Initial Motivation:
So, we know: for two groups to be isomorphic, a necessary - but not sufficient! -condition (as noted and proved here) is that their underlying sets have the same cardinality. I took this as a sort of starting point to start finding such groups. So, in this problem, I now seek $A,B,C,D$ such that
$$|A \times B| = |C \times D| = |A|\cdot |B| = |C| \cdot |D|$$
So it seems sufficient to think of $|A\times B|=|C \times D| = n$ for $n$ finite, and to find factors $a,b,c,d$ of $n$ such that
$$n=ab=cd$$
where $a,b,c,d$ are the factors of $n$, and the orders of groups $A,B,C,D$. In my case, $n=12$ seems a convenient example, as
$$12 = 2\cdot 6 = 3 \cdot 4$$
Some of the first groups that come to mind of the corresponding orders are, each with modular addition,
$$A = \Bbb Z / 2 \Bbb Z \;\;\;\;\;B = \Bbb Z / 6 \Bbb Z \;\;\;\;\;C = \Bbb Z / 3 \Bbb Z \;\;\;\;\;D = \Bbb Z / 4 \Bbb Z$$
Problems in What Remains:
So what remains is to construct an isomorphism $f : (\Bbb Z / 2 \Bbb Z \times \Bbb Z / 6 \Bbb Z) \to (\Bbb Z / 3 \Bbb Z \times \Bbb Z / 4 \Bbb Z)$ and demonstrate it, but I'm running into problems there, nothing seems to really work out, at least nicely. I also tried to just show each product was isomorphic to $\Bbb Z / 12 \Bbb Z$ but ran into the same fundamental problem.
So I'm guessing this product isn't the easiest to deal with. Indeed I also tried a slightly simpler
$$A = \Bbb Z / 2 \Bbb Z \;\;\;\;\;B = \Bbb Z / 2 \Bbb Z \;\;\;\;\;C = \Bbb Z / 4 \Bbb Z \;\;\;\;\;D = \Bbb Z / 1 \Bbb Z = \langle e \rangle$$
but I couldn't construct a nice function that wouldn't rely on a bunch of cases in proving it's an isomorphism. Is there perhaps a function that I'm overlooking, or an easier set of products to work with?
The problem is that $\mathbb{Z}/2\mathbb{Z} \times \mathbb{Z}/6\mathbb{Z}$ is not isomorphic to $\mathbb{Z}/3\mathbb{Z} \times \mathbb{Z}/4\mathbb{Z}$, and only the latter isomorphic to $\mathbb{Z}/12\mathbb{Z}$. The only time that $\mathbb{Z}/n\mathbb{Z}\times \mathbb{Z}/m\mathbb{Z} \cong \mathbb{Z}/(nm)\mathbb{Z}$ is when $n$ and $m$ are relatively prime. This fact should help you come up with an example that works.