Proving this non-empty set and binary operation is a group [duplicate]

Suppose we have a non-empty set $$P$$ equipped with an associative binary operation $$\bullet$$ such that for every $$a \in P$$ there exists a unique $$b \in P$$ with $$aba=a$$. How would we go about proving this is a group?

I have tried various things, and proved some smaller results such as for the element $$b$$, the corresponding unique element $$c$$ such that $$bcb=b$$ satisfies $$c=a$$, but every attempt to show this structure is in fact a group seems to rely on circular logic that either a unique identity exists, or each element has a unique inverse, both of which we obviously have to prove!

Any help would be much appreciated.

marked as duplicate by Theo Bendit, nmasanta, Bill Dubuque, José Carlos Santos, Daniele TampieriSep 12 at 6:44

For example, let $$P$$ consist of any two distinct reflections of a regular polygon. Then, under the usual composition of symmetries, all the required conditions are satisfied but $$P$$ is not a group.