Show that a semigroup with $aS \cup \{a\} = bS \cup \{b\}$ and $Sa \cup \{a\} = Sb \cup \{b\}$ is a group Let $S$ be a semigroup such that for all $a,b \in S$
$$
 aS \cup \{a\} = bS \cup \{b\} \quad \text{and} \quad
 Sa \cup \{a\} = Sb \cup \{b\}.
$$
where $aS = \{as : s \in S \}$ and similarly $Sa$. I want to show that $S$ is a group.
The above conditions imply
$$
 a \in bS
$$
for $a \ne b$, hence $S \setminus\{b\} \subseteq bS$ for all $b \in S$. If $S$ contains an idempotent $e$, then as $e \in eS$ we have $eS = S = Se$ and $e$ is the identity. With an identity element it is easy to see that $aS = S$ and $S = Sa$ for every $a \in S$, hence that $S$ is a group. 
So, if I could show that $S$ contains an idempotent then it follows that $S$ is a group. But here I am stuck, so could anyone provide a hint how to proceed?
By the way, this is an exercise from J. Howie Fundamentals of Semigroup Theory (page 61).
 A: As pointed out in the comments by DerekHolt, the key is Green's Lemma (as cited in the mentioned book on page 49). To formulate it, we start with an arbitrary semigroup $S$, and we define equivalence relations $\mathcal R$ and $\mathcal L$ on $S$ by setting
\begin{align*}
 a \mathcal R b & :\Leftrightarrow \{a\} \cup aS = \{ b \} \cup bS, \\
 a \mathcal L b & :\Leftrightarrow \{a\} \cup Sa = \{ b \} \cup Sb
\end{align*}
for all $a, b \in S$.
These are part of what is known as Green's relations.
Then we have:
(Green's Lemma) If $a \ne b$ and $a \mathcal R b$ with $as = b, a = bt$, then the maps
$$
 x \mapsto xs
 \quad \mbox{and} \quad
 x \mapsto xt
$$
are mutually inverse bijections between the $\mathcal L$-classes of $a$ and $b$, which preserve $\mathcal R$-classes. A similar (dual) relation holds if $a\mathcal L b$.
Proof: Its easy to see that $\mathcal L$ is a left congruence and $\mathcal R$ is a right congruence. Hence if $x\mathcal L a$ then $xs \mathcal L as$, so $xs \mathcal L b$ because $b = as$. Similarly, right multiplication by $t$ maps the $\mathcal L$-class of $b$ into the one of $a$. So the two maps between the $\mathcal L$-classes are well-defined. Also, if $x = ua$ then
$$
 xst = uast = ubt = ua = x
$$
and similarly $yts = y$ for all $y \mathcal L b$; hence they are mutually inverse on the corresponding $\mathcal L$-classes. Also, as $\mathcal R$ is a right congruence, the images of $\mathcal R$-related elements stay $\mathcal R$-related, but further as $x = (xs)t$ for $x \mathcal L a$ we have $x \mathcal R xs$ and so the mapping stays in the same $\mathcal R$-class for all elements $\mathcal L$-equivalent to $a$. $\square$
The assumption of the question gives that we just have a single $\mathcal R$-class and a single $\mathcal L$-class. So pick arbitrary $a \ne b$ and $as = b$ and $a = bt$, then for every $x \in S$ by the above we have
$$
 xst = x 
$$
giving that $e := st$ is idempotent (set $x := e$ above) and a right-identity. Further as the equations $ux = e$ and $xu = e$ are solvable for each $u \in S$ it must be a group. 
Remark 1: With further theory from the book it is shown that every non-empty intersection of an $\mathcal L$-class and an $\mathcal R$-class is a group.
Remark 2: In the paper Intersections of maximal ideals in semigroups by P. Grillet I found 

An ideal $I$ is maximal iff $S - I$ is a $\mathcal J$-class.

And the same proof works in case of right-ideals and $\mathcal R$-classes and left-ideals and $\mathcal L$-classes. So if $aS = S \setminus \{a\}$, then as $aS$ is a right ideal it is maximal and $\{a\}$ would be a single $\mathcal R$-class, which is excluded. Hence $aS = S$ for all $a \in S$. Similar $Sa = S$ for all $a \in S$ so that $S$ is a group. And the result follows without Green's lemma.
A: Your question is indeed related to Green's relations. The hypothesis tells you that all the elements of your semigroup are $\mathcal{R}$-equivalent and $\mathcal{L}$-equivalent. Therefore, there are all $\mathcal{H}$-equivalent. It now suffices to apply the following standard result (see for instance [1, Proposition 1.4]).

Let $H$ be an $\mathcal{H}$-class of a semigroup. The following
  conditions are equivalent:
  
  
*
  
*$H$ contains an idempotent,
  
*there exist $s$, $t \in H$ such that $st \in H$,
  
*$H$ is a group.
  

[1] P.A. Grillet, Semigroups, an introduction to the structure theory, Marcel Dekker, Inc., New York, 1995
