# Exercise 1 pg 33 from “Algebra - T. W. Hungerford” - example for a semigroup-hom but not monoid-hom..

I have from Exercise 1 pg 33 - "Algebra - T. W. Hungerford" following:

Question to proof: Show by example that the first conclusione may be false if $G,\, H$ are monoids that are not group.

I thinked:

Proof: let be for example two monoids $(G:=\{\emptyset\}, \bot)$ and $(H:=\{\emptyset, \{\emptyset\}\}, \top)$ with: $$\begin{array}{c|c} \bot & \emptyset \\ \hline \emptyset & \emptyset \end{array} \, \, \, \,\, \,\, \,\, \,\, \,\, \,\, \,\, \,\, \, \begin{array}{c|cc} \top & \emptyset & \{\emptyset\}\\ \hline \emptyset & \emptyset & \emptyset \\ \{\emptyset\} & \emptyset & \{\emptyset\} \end{array}$$ $G$ with $e_G:=\emptyset$ like neutral element and $H$ with $e_H:=\{\emptyset\}$ like neutral element. Let be $f$ a function from $G$ to $H$ with $\emptyset \mapsto \emptyset$ (namely $x \mapsto x$), the function is Homomorphismus in fact \begin{align} {\color{Red}f}{\color{Red}(}{\color{Red}x}{ \color{Red}\bot }{\color{Red}y}{\color{Red})}=&f( \emptyset \bot \emptyset)= {\color{Green}f}{\color{Green}(}{\color{Green}\emptyset}{\color{Green})}= \emptyset \\ {\color{Red}f}{\color{Red}(}{\color{Red}x}{\color{Red})} {\color{Red}\top} {\color{Red}f}{\color{Red}(}{\color{Red}y}{\color{Red})}=&f(\emptyset) \top f(\emptyset)= \emptyset \top \emptyset= \emptyset \\ &\text{with }x,y \in G \end{align} but it means that \begin{align} f(e_G)&\neq e_H \\f(e_G)={\color{Green}f}{\color{Green}(}{\color{Green}\emptyset}{\color{Green})}=\emptyset &\neq \{\emptyset\}= e_H \end{align} Therefore $f$ ist Semigroup-Hom but not Monoid-Hom...

Is it correct?

Consider the group $G=\{1\}$ and the monoid $H=\{0,1\}$; in the former the operation is obvious; in the second it is the usual multiplication. The map $f\colon G\to H$ defined by $f(1)=0$ is a semigroup homomorphism which is not a monoid homomorphism.
Another classical example is the map $f\colon\mathbb{Z}\to\mathbb{Z}\times\mathbb{Z}$ defined by $f(x)=(0,x)$, which is a group homomorphism when addition is considered, but only a semigroup and not monoid homomorphism with respect to multiplication. In the codomain, operations are performed componentwise.