I am trying to prove that $f(gh)=(fg)h$ for $f,g,h \in R[\mathbb{N}^n]$. Context to the exercise:
We define the polynomial ring $R[X_1,...,X_n]$ in $n$ variables as $$ R=[X_1,...,X_n] = R[\mathbb{N}^n] = \\\{ f:\mathbb{N}^n \to R | f(v)=0,|v| >> 0 \} $$ where $v=(v_1,...,v_n)\in \mathbb{N}$ and $|v| = v_1+...+v_n.$ A polynomial $f \in R[X_1,...,X_n]$ is the same as a function $f:\mathbb{N}^n \to R$ that is non-zero for only finitely many $v \in \mathbb{N}^n$. We let $X^v \in R\left[\mathbb{N}^n\right]$ denote the function given by $$ X^v(w)= \begin{cases}1 & \text { if } v=w, \\\\ 0 & \text { if } v \neq w .\end{cases} $$ With this notation, every polynomial $f \in R\left[\mathbb{N}^n\right]$ can be written as a (finite) sum $$ f=\sum_{v \in \mathbb{N}^n} a_v X^v, $$ where $a_v \in R$ (an element $r \in R$ is identified with the function mapping the zero vector to $r$ and everything else to $0 \in R$ ). If $f, g \in R\left[\mathbb{N}^n\right]$ we define $f+g$ by $(f+g)(v)=f(v)+g(v)$ and $f g$ by the (finite) sum $$ (f g)(v)=\sum_{v_1+v_2=v} f\left(v_1\right) g\left(v_2\right) $$ where $v_1,v_2 \in \mathbb{N}^n$.