Why is a monoid with right identity and left inverse not necessarily a group? [duplicate]

This problem is from Herstein's 'Topics in Algebra'. I've thought about it a bit but haven't come up with much.

Let $G$ be a non-empty set with an associative product which also satisfies:

  1. $\exists e\in G $ such that $\forall a \in G$, $a \cdot e=a$.
  2. Given $a \in G$, $\exists y(a) \in G$, such that $y(a) \cdot a =e$.

Prove that $G$ need not be a group.

I know that $G$ is a group if any one of those multiplications is switched around, i.e, either $a \cdot y(a)=e$ or $e \cdot a=a$. But I can't quite understand why in this case $G$ is not a group. I'd be much obliged if someone can give me a good explanation of why it must be and I'd also appreciate a counter-case if nothing else.

Thanks a lot. Cheers!


Solution 1:

Consider a set with two elements $a$ and $e$. Define the product of any finite number of elements however bracketed to be equal to the first (leftmost) symbol. This ensures the product is associative.

It is straightforward (I leave it to you) to check that the two defining properties hold, and to show that this is not a group.