Ring homomorphism where $g(1)$ is not identity
Solution 1:
A simple example is $R=S=\mathbb Z_{6}$ and $g(r)=3r$. Also, $g(r)=4r$ works.
In general, given rings with identity, $R_1,R_2,$ we can define $R=R_1\times R_2.$ $R$ is a ring with identity, $(1,1).$
Let $R_3=\{(r_1,0)\mid r_1\in R_1\}.$ $R_3$ is a subset of $R$ which is a ring, isomorphic to $R_1,$ but with a different identity, $(1,0),$ from $R.$
This shows that the concept of a subring is a bit tricky. If we are talking about the category of rings with identity, we have to be specific about whether a subring must have the same identity or if the identity can be different.