Let $M$ be a monoid and $R$ a ring, $f,g \in R^{(M)}$ (the functions from $M$ to $R$ with finite support), we define the convolution product as $$x\in M \implies (f*g)(x)=\sum_{yz=x} f(y)g(z).$$
Show that $R[M]:=(R^{(M)},+,*)$ is a ring (the operation $+$ is defined by $(f+g)(x)=f(x)+_Rg(x)$.
I could prove that $R[M]$ is an abelian group with $+$ and the distribution property. I had problems proving that $R[M]$ is a monoid with $*$.
I've tried to show that $f$ defined as $f(x)=1_R$ for all $x\in M$ is the identity for $*$, so if I take $g$, then
$$(f*g)(x)=\sum_{yz=x}f(y)g(z)=\sum_{yz=x}1_R.g(z)=\sum_{yz=x}g(z).$$
I would like to conclude that $\sum_{yz=x}g(z)=g(x)$. I suppose that this is true since this sum doesn't depend on $y$ but only on $z$, so instead of $yz=x$, it is $z=x$ Would this be correct?
My major doubt is about the associativity: let $f,g,h$, then
$$((f*g)*h)(x)=\sum_{yz=x}((f*g)(y))h(z)=\sum_{yz=x}(\sum_{wt=y}f(w)g(t))h(z).$$
I got stuck at that point.
I've already verified closure under $*$, I would appreciate if someone could tell me how to prove associativity and to check if what I've done for existence of identity element under $*$ is correct.
If you wish to know how convolution works, think of a situation where convolution appears naturally. Power series is perhaps the simplest example : $\big(\sum_{n\geq 0}f_nz^n\big)\big(\sum_{n\geq 0}g_nz^n\big)$ equals $\big(\sum_{n\geq 0}h_nz^n\big)$ where $h_n=\sum_{i+j=n}f_ig_j$.
This analogy already tells you that $1_R$ will be the function that maps $1_M$ to $1$ and all the other elements to $0$ (for power series, the identity element for multiplication is $1=1+0\times z+0\times z^2+\ldots$).
To check that it is actually an identity element, note that
$$ (1_R*f)(x)=\sum_{yz=x}1_R(y)f(z)= \sum_{yz=x,y=1_M}1_R(y)f(z)=\sum_{y=1_M,z=x}1_R(y)f(z)=f(x) $$ and similarly for $f*1_R$. For associativity, note that
$$ ((f*g)*h)(x)=\sum_{abc=x}f(a)g(b)h(c)=(f*(g*h))(x) $$