Under what assumptions can a semigroup $(S,*)$ be embedded into a group?
Group Theory – When Can a Semigroup Be Embedded into a Group?
group-theorysemigroups
Related Solutions
What you are describing is the left adjoint of the forgetful functor from Group to Semigroup.
In the case of monoids and monoid homomorphisms, such a group is called the enveloping group of a monoid. You can find the description in George Bergman's Invitation to General Algebra and Universal Constructions, Chapter 3, Section 3.11, pages 65 and 66.
However, you don't always get embeddings.
For semigroups, the most natural thing is to adjoin a $1$, even if the semigroup already has one, and then perform the construction. If $S$ already had an identity, the construction will naturally collapse the new, adjoined, identity into the original one, and give you "the most general group into which you can map the semigroup".
Added. In fact, what the last construction is doing (for semigroups) is simply composing the two right adjoints: the right adjoint of the forgetful functor from Monoid to Semigroup is the functor that adjoins an identity (since even between monoids there are generally more semigroup homomorphisms than monoid homomorphisms). So if we look at the composition of the forgetful functors Group $\longrightarrow$ Monoid $\longrightarrow$ Semigroup, we obtain a right adjoint by composing the adjoints going the other way, Semigroup $\longrightarrow$ Monoid (adjoin a $1$), and Monoid $\longrightarrow$ Group (enveloping group). So: first adjoin a $1$, then construct the enveloping group.
(Interestingly, there is another functor from monoids to groups, namely the functor that assigns to every monoid its group of units, $M^*$. This functor is the right adjoint of the forgetful functor: given any monoid $M$ and any group $G$, there is a natural corespondence between $\mathbf{Monoid}(G,M)$ and $\mathbf{Group}(G,M^*)$).
I don't think that the Prüfer $p$-group $C_{p^\infty}$ for a prime $p$, which has presentation $$\left\langle x_i\ (i \in {\mathbb Z_{> 0}}) \mid x_1^p=1,\,x_i^p = x_{i-1}\ (i > 1)\right\rangle,$$ can be embedded into $S_{\infty}$.
Suppose, for a contradiction that there were such an embedding. Then, since $x_i$ has order $p^i$, its image must have at least one orbit of length $p^i$. But then the images of $x_j$ must move at least $p^i$ points for all $j \le i$.
Since this is true for all $i>0$, the images of the $x_i$ in an embedding cannot have finite support, contradiction.
Best Answer
It is clear that if a semigroup is embedded into a group, it must be cancellative.
Clifford, Preston: The Algebraic Theory of Semigroups - Page 34. See also A. Nagy: Special classes of semigroups, Theorem 3.10, p.46
This construction is sometimes called group of quotients. This article at proofwiki is somewhat related to this construction.
For non-commutative semigroups, the situation is more complicated.
Clifford, Preston: The Algebraic Theory of Semigroups - Page 36
This paper might also be of interest: George C. Bush: The embeddability of a semigroup--Conditions common to Mal'cev and Lambek, Trans. Amer. Math. Soc. 157 (1971), 437-448.
EDIT: See also this wikipedia article which contains all the information I've given above and also a few further references. (Perhaps I should have searched wikipedia first, before posting this...)