I am trying to find monoids $G$ and $H$ and a semigroup homomorphism $f:G\to H$ that is not a monoid homomorphism.
I know that I need $f(1_G)\neq 1_H$.
Is this a valid example:
$f:(\mathbb{Z},\times)\to (\mathbb{Z},\times)$, $f(x)=0$. In this example, $f(xy)=f(x)f(y)$ for every $x,y\in \mathbb{Z}$, but $f(1)\neq 1$.
The reason I'm not sure about this example is that the image of $f$ is $\{0\}$, so it seems like the group $H$ should just be the trivial group, instead of $(\mathbb{Z},\times)$.
Does my example work? Or if not, can someone give me a hint about how to do this?
To add to the answers:
Any semigroup morphism $f:M\to S$ with $M$ a monoid, induces a monoid structure on the image $f(M)\subseteq S$, with $f(1)$ being its 'local' unit element.
However, if $f$ is not surjective, $f(1)$ needs not be a unit in the whole semigroup $S$, as your example shows.