Groups of the from $gMg$ in a monoid where $g$ is an idempotent Let $(M, \cdot)$ be a finite monoid with identity $e$. It is easy to see that $gMg = \{ gxg : x \in M \}$ forms a monoid with identity $geg = g$ if $g$ is an idempotent. If $gMg$ contains no idempotent other than $g$, it must be a group, since it is finite.
Suppose that $g, h \in M$ are distinct idempotents in $M$ such that both $gMg$ and $hMh$ are groups. Is it true that $gMg$ and $hMh$ are isomorphic?

This is true for any semigroup (even if it is not a monoid) and is easy to prove if you know about Green's relations.
If $S$ be a semigroup and $e$ is an idempotent of $S$, then $eSe$ is a monoid
(with identity $e = eee$). Suppose that $e$ and $f$ are idempotents such that $eSe$ and $fSf$ are groups. Then in particular, $e \mathrel{\mathcal H} efe$ and $f \mathrel{\mathcal H} fef$, which implies that $e \mathrel{\mathcal R} ef$ and 
$ef \mathrel{\mathcal L} f$, whence $e \mathrel{\mathcal D} f$. It follows by Green's Lemma, than the two groups $eSe$ and $fSf$, which are maximal groups of a regular $\mathcal D$-class, are isomorphic.
