Existence of a neutral element in set with an associative internal law

How can you try to find the answer?

If this were a group, then the condition holds (just take $x=a^{-1}ya^{-1}$). In that case, setting $y=a$ will give $a=axa$, which tells you that $ax=xa=e$. So perhaps one should try to see if that holds in this case: if we pick $x$ such that $a=axa$, will $ax=xa$ be the identity element?

Indeed it will.

We know that there exists $x$ such that $a=axa$.

Let $r\in E$; then there exists $z$ such that $r=aza$. Hence $(ax)r = ax(aza) = (axa)za = aza = r$. And $r(xa) = (aza)xa = az(axa) = aza = r$.

Thus, $ax$ is a left unit, and $xa$ is a right unit. But then $$\begin{align*} ax &= (ax)(xa) &&\text{(because }xa\text{ is a right unit)}\\ &= xa &&\text{(because }ax\text{ is a left unit)} \end{align*}$$ so $ax=xa$ is the two-sided unit.


I wrote this solution before noticing that Arturo published his own solution which is more elegant. I'm still sharing my solution with a bit of the reasoning for choosing a candidate because it's a bit different.

First when I tried to solve it, I wasn't what will be a good candidate of $e$, just like you mentioned. I thought $a$ might be a good candidate. But then when I tried to look at the group $\mathbb{Z}$, I noticed that $a=3$ satisfy the condition, so I figured $a$ is a bad candidate. I noticed that plugging $y=a^n$, gives $a^n = axa$ for some $x$, and if we want $x$ to be the identity, then using $n=2$ is our best choice (then we'll have $a^2 = axa = aea = aa$).

And now the dirty work:

$a^2 = aba$

Then, for some $y = axa$ we have:

$yba = ax(aba) = axa^2 = ya$

$aby = (aba)xa = a^2xa = ay$

And now for some $y = axa$ and some $z$ we have:

$ybz = (axa)bz = ax(abz) = ax(az) = (axa)z = yz$

Now, $b$ also have to satisfy the condition so for some $c$ we have $b=aca$. So now:

$bca = (aca)ca = ac(aca) = acb$

And then for some $y=axa$ using the previous 2 results we get:

$by = b(axa) = (aca)axa = (ac)aaxa = (abc)aaxa = a(bca)axa = a(acb)axa = aa(cba)xa = aa(ca)xa = a(aca)xa = abxa = (abx)a = (ax)a = axa = y$

and pretty much the same for $yb$.