Give an example of finitely generated, infinite monoid $M$ with property that for all $m \in M$ we've got $m^2 = m^3$.
This question comes from the problem I was given during algebraic languages theory class at CS department. I've got construction that is using methods outlined during that class but the structure of the monoid is not very clear.
I thought someone could propose more direct construction that would give better insight into methods of constructing such algebraic structures.
In a case there's no better solution I'm planning to share my own with brief explanation of methods used in that construction.