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 $\displaystyle \left\langle M,\circ\right\rangle$ is of the form $\displaystyle \left\{e,a\right\}$ where $\displaystyle e$ is the identity element. Note then that $\displaystyle e$'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 $\displaystyle a$. Since $\displaystyle a\circ e=e\circ a=a$ for any monoid, how $\displaystyle a$ may act differently is dependent only on what $\displaystyle a\circ a$ is. Particularly $\displaystyle a\circ a$ may be either $\displaystyle a$ or $\displaystyle e$. Clearly any monoid will be isomorphic to either of these constructions.