TITLE: Do Monoid Homomorphisms preserve the identity?
QUESTION [6 upvotes]: In both my textbook (Hungerford's Algebra), and in class, it is claimed that Monoid Homomorphisms are not required to preserve the identity. Interestingly enough, the Wikipedia page for Monoids requires Monoid Homomorphisms to preserve the identity element: https://en.wikipedia.org/wiki/Monoid#Monoid_homomorphisms. I haven't found an example of the former, so I thought I'd prove the opposite statement. 
I believe that I have proved the opposite assertion, based on the proof that I used to show that Group Homomorphisms preserve the identity. Since I don't use any information stating that elements are invertible, I think my proof is still valid.
Let $M, N$ be monoids, and let $f:M\rightarrow N $ be a homomorphism of monoids.
Let $m,e_{M} \in M$ be an arbitrary element and the identity in $M$ respectively .
Then:
$$f(m) = f(m\cdot e_{M}) = f(m)\cdot f(e_{M})$$
$$f(m) = f(e_{M} \cdot m) = f(e_{M}) \cdot f(m)$$
Thus: $$f(m)\cdot f(e_{M}) = f(e_{M}) \cdot f(m) = f(m), \forall m \in M $$
This seems to imply my assertion.
Is there anything wrong with my proof?

REPLY [2 votes]: Your proof just proves that for every element in $\text{Im}(f)$ the element $f(e)$ acts as a unit but it does not imply that this holds for every element of $N$, unless $f$ is surjective.
Hence it is necessary to require that a monoid homomorphism preserves unit.
Allow me to provide a ciunter-example that explain why we need to require in the definition of monoid-homomorphism the unit preservation properties, i.e. why it cannot be deduced.
Consider the the monoid $\mathbb N$ of the natural numbers with addition and let $B$ be the monoid of truth-values, i.e. $B=\{\bot=false,\top=true\}$ with the monoid structure given by the the logical or $\lor$ and having unit the truth value $\bot$.
The mapping $$\begin{align*}f \colon \mathbb N &\longrightarrow B\\
f(n)&=\top \\ \end{align*}$$ 
is a semigroup homomorphism, i.e. 
$$f(n+m)=\top=\top \lor \top =f(n)\lor f(m)$$ 
but it is not a monoid homomorphism, because it does not preserve the unit, $f(0) \ne \bot$.
Since monoids are semigroups it is interesting studying semigroup-homomorphism between them, nevertheless they should notnregarded as the correct notion of morphism for monoid. A good notion of morphism should oreserve all the structure and as the examle above shows semigroup-homomorphisms may fail in doing so.