If $ab = cd$ implies $a =c$ or $b = d$ then either $ab = a$ for all $a,b$ or $ba = a$ for all $a,b$ This is an interesting exercise taken from The Algebraic Theory of Semigroup by Clifford and Preston. Though semigroup theory seems like a more advanced theory, this problem can be solved using simple algebra and a basic understanding of mathematical logic, and of course, some exploration. I remember I have solved this exact same problem once, around two years ago, but with a very different approach that I can't remember how. I even doubt it was correct though.
Problem:

An operation $\cdot$ defined on a set $S$ has associative property. In addition, suppose the following hold:
For all $a,b,c,d \in S,$ if $ab = cd $ then either $a = c$ or $b = d$.
Prove that either $xy = y$ for all $x,y \in S$ or $xy=x$ for all $x,y\in S$.

Here is my attempt:

*

*Notice that, since $a(aa) = (aa)a$, we have $a = aa$ for every $a$ in $S$. Hence the statement is true if S contains only one element.


*Assume that $S$ has at least two elements.


*Let $a$ and $b$ be two elements of S. From the fact that $a(ba) = (ab)a$, we can conclude either $a = ab$ or $ba = a$. We will prove that both can not hold simultaneously.


*For the sake of contradiction, assume, if possible, that there are $a,b,c,d$ in $S$ with $a ≠ b$ and $c ≠ d$ such that
$ab = a$ and $cd = d$.


*Notice that for any $t$ in $S$ the relations $(ta)b = ta$ and $c(dt) = dt$ imply $ta = t$ and $dt = t$. We also have $tb = t$ and $ct = t$ for all $t$ in $S$.


*But then we have
$ba =b = cb$, therefore $b = c$,
and
$ca = dc = c$, therefore $a = c$.
Which means $a = b$. Contradiction.


*Thus, either $a = ab$ for all $a,b$ in $S$ or $ba = a$ for all $a,b$ in S.
My doubts: I doubt my argument in (4). Does it really the right negation? This assumption is really important since it is used extensively in (5) and (6). My biggest doubt is caused by (5) since I got exactly $a = b = c = d$ using it.
Thanks in advance. Any other proofs are welcome.
 A: I think your argument works -- except that "both cannot hold simultaneously" is a somewhat inaccurate way of stating your plan. That sounds like you're saying that it's impossible that $ab=a=ba$ -- which is true (assuming $a\ne b$) but is not the path you're actually following with your argument. You'd probably want to say something like "these two cases cannot both appear in $S$".

Here's shorter way to arrange the key pieces of your argument:
Left case. Suppose there exists at least one distinct pair $a\ne b$ with $ab=a$.
Then just the first half of your step 5 shows that $ta=t$ for all $t$. If you choose $t\ne a$, then we can now repeat the same argument starting with $ta=t$ instead of $ab=a$, concluding $ut=u$ for all $t\ne a$ and arbitrary $u$.
In total we have proved $xy=x$ no matter whether $y=a$ (namely, take $t=x$) or $y\ne a$ (namely, take $t=y$, $u=x$).
Right case. Suppose the assumption of the left case does not hold -- that is, whenever $a\ne b$ it holds that $ab \ne a$.
Then your step 3 shows $ba=a$ for every choice of $a$ and $b$.
