How can I prove that there are only two monoids with two elements?
You mean two monoids that aren't isomorphic right?
To see this merely note that any two element monoid is of the form where is the identity element. Note then that 's interaction with other elements of the monoid is fixed no matter how the other elements of the monoid act (since it is the identity element) therefore the only thing that may act differently is . Since for any monoid, how may act differently is dependent only on what is. Particularly may be either or . Clearly any monoid will be isomorphic to either of these constructions.