Show that $S$ is a group if and only if $aS=S=Sa$. 
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.)
 A: 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.
A: Let $a \in S$. Since $aaS = S = Saa$, there exist $b, c \in S$ such that $(aa)b = a$ 
and $c(aa) = a$. 
Setting $e = ca$, one gets $e = ca = c(aa)b$ and $c(aa)b = ab$. Therefore $e = ca = ab$ and $ee = (ca)(ab) = c(aa)b = e$. In particular $e$ is idempotent. 
Let now $x \in S$. Since $eS = S$, there exist $y, z \in S$ such that $ey = x$ and $ze = x$. Then $ex = eey = ey = x$ and $xe = zee = ze = x$. Thus $S$ is a monoid with identity $e$. Finally, as $xS = S$ and $Sx = S$, there exist $u, v \in S$ such that $xu = e$ and $vx = e$. Thus $S$ is a group.
A: This is a summary proof partially inspired by @David.
Proof.
($S$ has an id) Let $a$ be any item in $S$. Because $aS=S$, exists $e\in S$ such that $ae=a$ ($e$ is the right-id of $a$). Need to show that $e$ is actually the right-id of all items in $S$ (not just $a$).
To do this, let $x$ be any item in $S$. Since $S=Sa$, exists $y\in S$ such that $x=ya$. Therefore, $xe=yae=ya=x$. That is to say, $e$ is the right-id of $x$ (or any item in $S$). Samely, we can show that $S$ has a left-id $e'$.
Since $e'$ is the left-id, $e'e=e$. Since $e$ is the right-id, $e'e=e'$. That is to say, $e=e'e=e'$, and hence $S$ has a unique id $e$.
(Any item in $S$ has an inverse) Let $a\in S$. Becuase $aS=S$, exists $a^{-1}\in S$ such that $aa^{-1}=e$ ($a$ has a right-inverse). Samely, since $Sa=S$, $a$ has a left-inverse $A^{-1}$ such that $A^{-1}a=e$.
Since $aa^{-1}=e$, $A^{-1}aa^{-1}=A^{-1}e$, $ea^{-1}=A^{-1}$, $a^{-1}=A^{-1}$. That is to say, $a$ has a unique inverse.
($S$ is a group) Follows immediately from above. $\blacksquare$
