Let $f:S\to T$ be a surjective mapping of monoids that holds the homomorphic property: $f(xy)=f(x)f(y)$. I want to show that $f$ is a homomorphism and also find an example of a mapping that holds the homomorphic property, but not having $f(1_S) = 1_T$.
My attempt is in the answer below.
Hint: Try the map $f\colon S \to T$ defined by $f(x) = 1_T$ for all $x$.
For a less trivial example consider the ring $A = k[x]/(x^2 - x)$ and let $S = (A, \cdot)$. Then the map $f\colon S \to S$ defined by $f(a) = ax$ is a homomorphism.