Take $\varphi: R_1 \longrightarrow R_2$, and $f:G_1 \longrightarrow G_2$.
In order to prove $\varphi$ is a ring homomorphism, we must show $\varphi(1_{R_1})=1_{R_2}$ (in addition to other properties), but to prove $f$ is a group homomorphism it suffices just to show $f(g_1\cdot g_2) = f(g_1)\cdot f(g_2)$, with $f(e_{G_1})=e_{G_2}$ being implied - how is this so?
Referencing this post about why we need to specify $\varphi(1_{R_1})=1_{R_2}$, the zero map is brought up as an example of why we need this specification, since $0_{R2}$ might not be the identity element of $R_2$, but $\varphi(1_{R_1}\cdot r) = \varphi(1_{R_1})\cdot\varphi(r)= 0 \cdot 0$, so $0_{R_2} \textbf{will}$ be the identity element of $\varphi(R_1)$.
But doesn't this same reasoning apply to our group homomorphism $f$? The following proof from my textbook for why $f(e_{G_1}) = e_{G_2}$ seems like it should theoretically hold for rings...
$e\cdot g = g$
$f(e\cdot g) = f(g)$
$\Rightarrow f(e) \cdot f(g) = f(g)$
$\Rightarrow f(e)$ is the identity element of $G_2$
The last implication assumes that $f(g)$ is invertible (since you only multiplied by $f(g)^{-1}$ to the right on both sides to get that $f(e)$ is the identity element), and this might not be the case for a ring, since there are ring elements that are not invertible. In the counterexample that you pointed out, as you said, $f$ could be the zero map and, in this case, $f(x)$ is not invertible, so the argument used for group homomorphism does not apply there.