$f (e_G )=e_H $ is necessary for Monoid homomorphisms In abstract algebra $-$  hungerford, 
a question is given as
If $f: G\to H $ is a homomorphism  of groups, then $f (e_G)=e_H$  and  $f (a^{-1}) ={ f (a)}^{-1} $  for  all $a\in G $ .
Show  by example that the first conclusion may be false if G and H are monoids that are not a group. 
Please look it. 
Monoid homomorphism 
Here  $f (e_G )=e_H  $ is taken in definition of Monoid homomorphism. 
That confuses. 
Again , for semigroup homomorphism on two groups, when preserving identify be a group homomorphism, 
Why this fails for Monoid homomorphism ?
Is there have any geometrical significance? 
Thanks for reading. 
 A: The most important application of this phenomenon, in my opinion, is to ring theory. A ring with $1$ is a monoid under multiplication, and ring homomorphisms do not have to send $1$ to $1$ (unless explicitly defined to do so). One example is the following:
$$M=(\Bbb Z\times\Bbb Z,\cdot)\\(a,b)\cdot(c,d)=(ac,bd)$$together with the function $$h:M\to M\\(a,b)\mapsto (a,0)$$ This function clearly satisfies the homomorphism property, but it doesn't send $e_M=(1,1)$ to $(1,1)$. 
A: As you noticed groups have this property: every semigroup-homomorphism between them is also a group-homomorphism.
This result can be generalized, indeed the same proof allows to show that every semigroup-homomorphism from a monoid to a group preserves the unit.
If you look at the proof you can notice that what makes this magic possible is the existence of inverse and the fact that the unit is idempotent. 
Since semigroup-homomorphisms preserve the property of being idempotent and since in a group there can be only one idempotent, namely the unit, it follows that the image of every idempotent must be sent in the unit of the group. From this it follows in particular the unit-preservation property.
Since in a monoid an idempotent is not necessarily a unit the above argument does not work and indeed it is possible to provide semigroup-homomorphisms between monoid which are not monoid-homomorphism.
If you want I can provide some counter-example, anyway I hope I made clear what is the reason why this magic works for groups.
