Ring with convolution product 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.
 A: 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)
$$
A: To expand on Ewan's answer: I claim that $R[M]$ is isomorphic (as a set with two binary operations) to a ring of polynomials over $R$ where the exponents are indexed by $M$.  That is, $R[M] \cong \bigoplus_{m\in M} R \cdot X^m$, where the $X^m$ are symbols satisfying $X^{m} X^{m'} = X^{m m'}$.  In particular, it is a ring.
If $M$ is the monoid of nonnegative integers, then this is exactly the polynomial ring $R[X]$.  Otherwise, it is not literally a polynomial ring, but still behaves like one.  Specifically, it obeys the multiplication law:
$$\left(\sum_m a_m X^m \right) \left(\sum_{m'} b_{m'} X^{m'} \right) =\sum_{m,m'} a_m b_{m'} X^{mm'}$$
The coefficient of $X^{m''}$ in the result is exactly $\sum_{mm' = m''} a_m b_{m'}$.  This looks an awful lot like the definition of the convolution product...
In fact, what I've written is quite nearly a proof.  All that really needs verification is that the obvious map $f\mapsto \sum f(m) X^m$ gives a bijection.  It clearly preserves addition, and the equation above shows that it preserves multiplication.
