Let $S$ be a semigroup. Show that $S$ is a group if and only if $aS=S=Sa$ for all $a\in S$.
Since it is if and only statement, we have to show that if $S$ is a group then $ aS=S=Sa$, which I already know how to do.
The other part: if you have $aS=S=Sa$, then prove that $S$ is a group.
(NB: See the comments for the original thoughts on the problem.)
Here is an outline, see if you can fill in the details.
Pick a specific $a\in S$. Then $a\in aS$, so $a=ae$ for some $e$.
(Aim: this means that $S$ has no possible identity element except $e$, so we have to prove that $e$ actually is an identity.)
For any $x\in S$ we have $x\in Sa$, say $x=ya$. Therefore $$xe=yae=ya=x\ .$$ This proves that $e$ is a right identity, that is, $xe=x$ for all $x\in S$.
See if you can explain for yourself why every element has a right inverse: that is, for all $x$ there exists $y$ such that $xy=e$.
To show that the right inverse is also a left inverse, let $xy=e$ and $yz=e$, then simplify $$yxyz$$ in two ways to show that $yx=e$.
Finally, show that $e$ is also a left identity.