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.