Describe a subring of the ring of functions from a monoid to a ring Let $H$ be a non-empty set and $S$ the set of all finite sequences over $H$, including the empty sequence $e := ()$. We make $S$ a monoid by deﬁning a multiplication on $S$ by concatenation. Let $R$ be a ring with $1$, and $R[S]$ be the set of all functions from $S$ to $R$. For $f, g ∈ R[S]$ and $x ∈ S$, deﬁne $(f + g)(x) := f (x) + g(x)$, and $$(f g)(x):=\sum_{(a,b)\ \in \ S\times S\ : \ ab \ =\ x} f(a)g(b),$$ which makes $R[S]$ a ring. For $h ∈ H$ , deﬁne $f_h ∈ R[S]$
by $f_h((h)) := 1$ and $f_h(s) := 0$ for $s\neq (h)$. The question is: What is the subring of $R[S]$ generated by $\{f_h, h ∈ H\}$ and the identity element of $R[S]$?
I could be wrong, but I believe that the identity $I$ of $R[S]$ is the function such that $I(s)=1$ if $s=e:=()$ and $I(s)=0$ otherwise. But I don't understand why the subring of the question is in fact a subring. For example, suppose $H=\{u,v\}$. Then, $(f_u+f_v)((u))=(f_u+f_v)((v))=1$, and I guess that $f_u+f_v$ could be $1$ only for one $h\in H$. 
I'd appreciate if someone could help. Sorry about the long text, it is my first time here, and I'm not that good in English. Thank you! 
 A: 
I believe that the identity $I$ of $R[S]$ is the function such that $I(s)=1$ if $s=e:=()$ and $I(s)=0$ otherwise.

Yes, that's right. It might be helpful to go one step further and note that we can identify $R$ inside $R[S]$ by the function $r(x)=r$ if $x=e$ and $r(x)=0$ otherwise.

But I didn't understand why the subring of the question is in fact a subring.

It's OK: the subring generated by a subset $X$ of a ring is by definition a subring. If you really want to know what it looks like, it looks like finite sums of finite products of elements of $X$ (including the empty product, which is the identity element.)

Then, $(f_u+f_v)((u))=(f_u+f_v)((v))=1$ ... 

This is correct, and $(f_u+f_v)(x)=0$ for any $x\in S\setminus \{u,v\}$. If $u\neq v$ then indeed $f_u+f_v$ is nonzero on two elements.

and I guess that $f_u+f_v$ could be $1$ only for one $h\in H$.

No... there isn't any reason to expect that. In general $f_x$ is going to be nonzero on finitely many elements of $S$. If you can pick $10^6$ distinct elements of $S$ and add them this way, the resulting function is $1$ on those $10^6$ places.
An observation
What is unusual here is that you've defined $R[S]$ to be the entire set of functions from $S$ into $R$. $R[S]$ is often used to denote the semigroup ring, but for semigroup rings you need to restrict attention to the functions which are finitely nonzero. In fact, I believe you need to add this restriction into what you've written, because otherwise you have no guarantee the sum you're using is defined (what if it's an infinite sum?)
This would bring you into the normal definition of a semigroup ring. Then you can alternatively view the functions as "formal linear combinations" using $S$ as a basis. The function simply tells you what the coefficients of the linear combination are, and because the function has finite support, it is only a finite linear combination.
The subring
Work to show that it is the group ring $\mathbb Z_n[S]$ where $\mathbb Z_n$ is the subring of $R$ generated by $1$. In terms of the definition you've given, it would be the functions $S\to \mathbb Z_n$ of finite support. It's a simple matter to show that these elements form a subring generated by the particular elements you picked out.
