Commutative semigroup, ring, commutative ring of functions I have problems solving the following:
Let $G$ be a commutative semigroup, $R$ a ring and define
$R[G] = \{ f: G \rightarrow R \ | \ card \{g \in G \ | \ f(g) \neq 0 \} < \infty \}$.
Addition is standard : $(f_1+f_2)(x) = f_1(x) + f_2(x)$
And multiplication is defined like this: $(f_1 \cdot f_2)(x) = \sum _{g_1g_2=x} f_1(g_1) \cdot f_2(g_2)$
So this is a set of functions from $G$ to $R$ which aren't $0$ only for a finite number of $g$'s.
I need to prove that it is a commutative ring.
It's obvious that it is an abelian group, without using the fact that $G$ is a semigroup (or at least I think I didn't use that). If $f \in R[G] \Rightarrow -f \in R[G]$ and $f=0$ is the addition identity here.
I think this structure is closed under multiplication, because if we multiply a nonzero value by a nonzero value, we get a nonzero value (and this can happen only finitely many times) and if we multiply a value by a zero value, we get zero, so nothing bad happens.
I have serious problems proving that multiplication is commutative.
Could you help me with that?
 A: It might help if we simplified the task a little. Consider the functions $\hat{g}:G\to R$
 which are $1$ at $g$ and zero elsewhere.
To make a function which is $r$ at $g$ instead, you just use the function $r\hat{g}=\hat{g}r$. You can get a new function from $G$ into $R$ at any time by multiplying by an element of $R$ like this.
What do these look like when we apply the definition of multiplication? Well, $(r\hat{g})(s\hat{h})$ is only nonzero at $gh$, where it has value $rs$, and that means $(r\hat{g})(s\hat{h})=rs(\widehat{gh})$
What about a function that is nonzero on more places? Since there are only finitely many nonzero places, you can get any function you want by adding finitely many of the functions we've already mentioned: $\sum r_g\hat{g}$. Every function decomposes this way.
But then look: if you prove that $r\hat{g}\cdot s\hat{h}=s\hat{h}\cdot r\hat{g}$ for all $r,s\in R$ and $g,h\in G$, then after distributing a product $(\sum r_g\hat{g})(\sum s_h\hat{h})$ out to $(r_g\hat{g})(s_h\hat{h})=r_gs_h(\widehat{gh})$, it becomes obvious that if $R$ and $G$ have commutative multiplication, these little terms commute and so does the whole product.

In my humble opinion, the functional representation of the semigroup ring obscures this fact more than the "formal construction" of $R[G]$ does.
In that scheme, we formally make elements of the form $\sum r_gg$ where $r_g\in R$ and $g\in G$, and only finitely many of the $r_g$ are nonzero. Addition and multiplication are defined in the obvious ways: you add on "like terms" (elements of $G$) and multiplication is just distributively multiplying these sums like you would for polynomials.
This is equivalent to the hints I gave with the $\hat{g}$ above. Just as the $g$ formally generate this construction, the $\hat{g}$ generated the functional construction.
A: I don't see any problem. If $R$ is commutative then $$(f_1 \cdot f_2)(x) = \sum _{g_1+g_2=x} f_1(g_1) \cdot f_2(g_2)= \sum _{g_2+g_1=x} f_2(g_2) \cdot f_1(g_1)=(f_2 \cdot f_1)(x).$$
If $R$ is not commutative, $ab\ne ba$, then set $f_1(x)=f_2(x)=0$ for $x\ne 1$ (for simplicity I suppose that $G$ has an identity element) and $f_1(1)=a$, $f_2(1)=b$, then $f_1\cdot f_2\ne f_2\cdot f_1$.
