TITLE: Cancellation of Direct Products
QUESTION [9 upvotes]: Given a finite group $G$ and its subgroups $H,K$ such that $$G \times H \cong G \times K$$ does it imply that $H=K$.
Clearly, one can see that this doesn't work out for all subgroups. Is there any condition by which this can remain true.

REPLY [2 votes]: Concerning Steve D's interpretation of the question, here is a partial answer.
Consider the following property (P) of a group: for any two subgroups $H$ and $K$ of $G$, if $H \cong K$, then $H = K$.
Claim: For a finite group $G$, the following are equivalent:
(i) $G$ has property (P).
(ii) $G$ is cyclic.
Cyclic groups are characterized among finite groups by having at most one subgroup of any given order, so certainly (ii) $\implies$ (i).
Conversely, assume $G$ has property (P).  Then it is a Dedekind group: all of its subgroups are normal (for otherwise it has two subgroups which are conjugate -- hence isomorphic -- but unequal).
Case 1: $G$ is abelian, of exponent $N$.  Then $G$ is isomorphic to $C_N \times G'$ for some subgroup $G'$ (this is a step in the classification of finite abelian groups; it also follows easily from the theorem).  If $G'$ is not cyclic, then $G'$ is not trivial hence contains an element of order $p | N$ and thus over all $G$ contains at least two subgroups of order $p$.
Case 2: $G$ is a nonabelian Dedekind group, i.e., a Hamiltonian group.  As Dedekind showed, a Hamiltonian group (finite or otherwise!) must contain a subgroup isomorphic to the quaternion group $Q_8$.  But $Q_8$ contains three cyclic subgroups of order $4$, namely those generated by the elements $i$, $j$ and $k$.
There are some noncyclic infinite abelian groups with property (P), e.g. $\mathbb{Q}/\mathbb{Z}$, but probably one can classify them as well: I haven't thought much about it.