Structure theorem for a class of idempotent monoids (where $xy = x$ or $xy = y$ for all $x, y$) Question. Is there any structure theorem for the class of monoids $H$ with the property that $xy = x$ or $xy = y$ for all $x, y \in H$? Or does this look hopeless for some good reasons?
A monoid with the above property is idempotent and need not be commutative. Examples include (i) the unitization of a left (resp., right) singular semigroup, where one starts with a set $X$ and defines an associative binary operation on $X$ by taking $xy := x$ (resp., $xy := y$) for all $x, y \in X$; or a chain of subsets of a "universe" $V$ made into a monoid by the operation that maps two sets in the chain to their union.
I'm aware of the work of D. McLean in [Idempotent semigroups, Amer. Math. Monthly 61 (1954), 110-113] and N. Kimura (e.g., [The structure of idempotent semigroups. I, Pacific J. Math. 8 (1958), No. 2, 257-275]) on the structure of idempotent semigroups, but I'm wondering if something more precise/specific can be done/has been done for the monoids of this thread.
Motivation. The question arises from the study of the arithmetic of a certain monoid of sets, $P_{\text{fin},1}(H)$, naturally attached to an arbitrary monoid $H$ (written multiplicatively). More precisely, $P_{\text{fin},1}(H)$ is obtained by endowing the family of all finite subsets of $H$ containing the identity $1_H$ with the operation of setwise multiplication induced by $H$ (this thing is now commonly referred to as the reduced power monoid of $H$), and one can show that $P_{\text{fin},1}(H)$ enjoys a form of unique factorization if and only if $H$ satisfies the above property (that $xy = x$ or $xy = y$ for all $x, y \in H$).
 A: The semigroups in the question seem to have first been introduced by Redei in his book Algebra. Vol 1. The book was originally published in Hungarian in 1954, and then German in 1959.  The English edition is 1967. In the English version they are called breakable semigroups. The main result in the English edition about them is Theorem 50 of section 27 which is the result in the previous answers that you have a bunch of left/right zero semigroups indexed by a totally ordered set with the product of elements from different indices the one in the smaller indexed set. This is more or less immediate from the definition and the fact that a band is a semilattice of rectangular bands if you are familiar with semigroup structure theory. This is more or less what @YemonChoi explains in his answer in detail.
A: Here are some initial thoughts (but I am both rusty and away from my reference books). I am going to use the terminology "band" rather than "idempotent semigroup" and "semilattice" rather than "commutative idempotent semigroup" since this is the terminology in Howie's book(s) which is where I first learned this topic.

If I recall correctly: the structure theory for bands that you mention implies in particular that every band $B$ admits a surjective homomorphism q onto a canonical "structure semilattice" $L$, in which each fibre $R_t:=q^{-1}(t)$ is a so-called rectangular band.
Since the defining property you are interested in passes to quotients, if $S$ is a semigroup of the form you describe, we know that its "structure semilattice" $L$ must be totally ordered.
A rectangular band is a semigroup $R$ which satisfies the equation $xyz=xz$ for all $x,y,z\in R$. Every rectangular band is isomorphic to one of the following form: take non-empty sets $I$ and $J$ and equip $I\times J$ with the multiplication defined by $(i_1,j_1)\cdot (i_2,j_2) = (i_1,j_2)$. If we also require that this semigroup satisfies the "defining condition" in your question, then:

*

*if $|I|\geq 2$ then $|J|=1$;

*if $|J|\geq 2$ then $|I|=1$.

In the former case, we have $xy=x$ for all $x,y\in R$; in the second case, we have $xy=y$ for all $x,y\in R$.
Thus, if $S$ is a semigroup of the form you describe, and $L$ is its structure semilattice, with quotient map $q:S\to L$ then $L$ is totally ordered and for each $t\in L$ the fibre $R_t=q^{-1}(\{t\})$ is either left absorbing or right absorbing in the sense of the previous paragraph.
Now let $s,t\in L$ with $s\neq t$; without loss of generality $s\preceq t$, that is to say $st=s=ts$. We know that for each $x\in R_s$ and $y\in R_t$ we have $xy,yx\in R_s$; since $xy\in\{x,y\}$ we must have $xy=yx=x$. So whenever we multiply two elements in different fibres, their product is always "the element in the lower fibre".
I think this determines the global multiplication table of $S$, provided one is given the fibring map $q:S\to L$. I suspect that conversely, given a totally ordered semilattice $L$ and a family $(R_t)_{t\in L}$ where each $R_t$ is either a left-absorbing or a right-absorbing semigroup, then $S=\bigsqcup_{t\in L} R_t$ will become a semigroup satisfying $xy\in\{x,y\}$ for all $x,y\in S$ provided we adopt the "when multiplying elements in different fibres, take the one in the lowest fibre" rule -- I admit I haven't thought in detail about verifying associativity.
A: The non-associative case
We say that an operation $\cdot$ on a set $X$ is conservative if for all $x,y\in X$ either $xy=x$ or $xy=y$. If $\cdot$ is conservative, then we can define two relations $R,S$ by setting $R=\{(x,y)\mid xy=x\}$ and $S=\{(x,y)\mid xy=y\}$. Then $R\cup S=X^2$ and $R\cap S=1_X$. Therefore, $R,S$ are complements in the Boolean lattice $[1_X,X^2]$. In fact, the conservative operations on $X$ are in a one-to-one correspondence with the elements in the interval $[1_X,X^2]$. If the operation $\cdot$ is associative, then the operations $R,S$ are pre-orderings; $(x,y)\in R$ precisely when there is some $r$ with $ry=x$, and $(x,y)\in S$ precisely when there is an $s$ with $xs=y$.
The associative case
If $X$ is a small set, then it is not too difficult to write a brute force search algorithm that counts the number of conservative semigroups on a set $X$ in order to count the number of conservative semigroups (for the programmers out there, backtracking algorithms are faster but harder to code). The number of conservative semigroups on a set $X$ with $|X|=n$ is sequence A292932 on the online encyclopedia of integer sequences.
The conservative semigroups have been investigated in the ~2019 paper Quasitrivial semigroups: characterizations and enumerations by Miguel Couceiro, Jimmy Devillet, Jean-Luc Marichal. In that paper, conservative binary operations are called quasitrivial; conservative binary operations were studied several decades before that paper was written. In that paper, we have the following characterization of the conservative semigroups.
If $\preceq$ is a pre-ordering, then define an equivalence relation $\simeq_\preceq$ by letting $x\simeq_\preceq y$ precisely when $x\preceq y\preceq x$. We say that a pre-ordering $\preceq$ is a pre-linear ordering if whenever $x,y\in X$, either $x\preceq y$ or $y\preceq x$.
Theorem: An operation $F:X^2\rightarrow X$ is associative and conservative if and only if there is a pre-linear ordering $\preceq$ on $X$ where if $A,B$ are equivalence classes with respect to $\simeq_\preceq$, then

*

*$F|_{A\times B}=\max_{\preceq}|_{A\times B}$ whenever $A\neq B$, and


*$F|_{A\times B}=(\pi_1)|_{A\times B}$ or $F|_{A\times B}=(\pi_2)|_{A\times B}$ whenever $A\neq B.$
An opinion about terminology
What I call a conservative binary operation has been called a strongly idempotent, breakable, or quasi-trivial binary operation by others. The term 'conservative' is consistent with the use of this term in cellular automata and reversible circuits. For example, a logic gate $C:F_2^n\rightarrow F_2^n$ is said to be conservative if $\mathbf{x}$ and $C(\mathbf{x})$ always have the same number of $1$-bits.
We can generalize these two notions of conservativism with this definition; a function $f:X^n\rightarrow X^m$ where $n\geq m$ is said to be conservative if whenever $f(x_1,\dots,x_n)=(y_1,\dots,y_m)$, we have
$|\{j\mid 1\leq j\leq m,y_j=a\}|\leq|\{i\mid 1\leq i\leq n,x_i=a\}|$ for each $a\in X$.
