This is an example from Hungerford's textbook ''Algebra''.
Let G and H be multiplicative groups and $f:G \rightarrow H$ a homomorphism of groups. Let R be a ring and define a map on the group rings $\bar{f}:R(G) \rightarrow R(H)$ by: $$\bar{f} \left( \sum_{i=1}^{n}r_i g_i \right) =\sum_{i=1}^{n}r_i f(g_i) $$
Then, $\bar{f}$ is a homomorphism of rings.
I know that we have to show that given $a, b \in R(G)$, $\bar{f}(a + b) = \bar{f}(a) + \bar{f}(b)$ and $\bar{f}(a b) = \bar{f}(a) \bar{f}(b)$.
Given $a = \sum_{i=1}^{n}r_ig_i$ and $b=\sum_{i=1}^{n}s_ig_i$, I showed that $\bar{f}(a + b) = \bar{f}(a) + \bar{f}(b)$.
However, I got stuck trying to show that $\bar{f}(a b) = \bar{f}(a) \bar{f}(b)$.
This is how I did it so far:
$\bar{f}\left(\sum_{i=1}^{n}r_ig_i \cdot \sum_{i=1}^{n}s_ig_i \right) $ = $\bar{f}\left(\sum_{i=1}^{n} \sum_{i=1}^{n}(r_is_i)(g_ig_i) \right) $
= $\sum_{i=1}^{n} \sum_{i=1}^{n}(r_is_i)f(g_ig_i)$
= $\sum_{i=1}^{n} \sum_{i=1}^{n}(r_is_i)f(g_i)f(g_i)$
I'm not sure it is the correct approach. And if it is, I don't know to finish it, given that neither the groups nor the rings are required to be commutative.