I'm working through an old qualifying exam problem, and I'm stuck:
Let $R \neq (0)$ be a finite ring such that for any element $x \in R$ there is $y \in R$ with $xyx = x$. Show that $R$ contains an identity and that for $a,b \in R$ if $ab = 1$ then $ba=1$.
On first glance, I suspected that $xy$ is a perfectly good identity, but this doesn't work. For example, in $\mathbb Z_6$, if $x = 3$, then $y \in \{1, 3, 5\}$ works, but $xy = 3 \neq 1$.
Once I have solved the first part, I can do the second part, using an argument from another MSE answer.