In Hungerford's Algebra, page 150, the author defines a ring of polynomials in "$n$" indeterminates in the following manner:

After the author defines the operations in this ring with a theorem:

saying that the author defines another definition to a ring of polynomials with $n$ indeterminates:

My problem is with the terminology in this theorem which comes after:

If I understood well, the author defines a function $x_i$ which when we applies to $\epsilon_i$, we have the identity in $R$. following this reasoning what is $x_i^k(k\epsilon_i)?$ is this the composition of $x_i$? I'm very confused with these terminologies, I need help.
Thanks a lot!
It's not the composition, but just the multiplication of $x_i$ with itself $k$ times (as usual). Note that Theorem 5.3 defines a multiplication operation on $R[x_1,\ldots,x_n]$, via $$(fg)(u)=\sum_{\large\substack{v+w=u\\ v,w\in\mathbb{N}^n}}f(v)g(w).$$ So for example, writing $x_i^2$ for the product $x_ix_i$, $$(x_i^2)(2\epsilon_i)=\sum_{\substack{v+w=2\epsilon_i\\ v,w\in\mathbb{N}^n}}x_i(v)x_i(w)=\bigg[x_i(0)x_i(2\epsilon_i)\bigg]+\bigg[x_i(\epsilon_i)x_i(\epsilon_i)\bigg]+\bigg[x_i(2\epsilon_i)x_i(0)\bigg]$$ $$=[0\cdot 0]+[1\cdot 1]+[0\cdot 0]=1$$ (where we have used the defining property $x_i(\epsilon_i)=1$ and $x_i(u)=0$ for any other $u$).
The correspondence with our usual conception of polynomials is as follows: for any polynomial $F\in R[x_1,\ldots,x_n]$, the corresponding function $\mathbf{F}:\mathbb{N}^n\to R$ is defined by $$\mathbf{F}(k_1\epsilon_1+\cdots+k_n\epsilon_n)=\text{the coefficient of }x_1^{k_1}\cdots x_n^{k_n}\text{ in the polynomial }F.$$ Let's do an example in $\mathbb{Z}[s,t]$ (I'm using $s$ and $t$ to avoid confusion with the functions $x_1,x_2$): $$F=2+t+5s^2$$ corresponds to the function $\mathbf{F}:\mathbb{N}^2\to \mathbb{Z}$ defined by $$\mathbf{F}(u)=\begin{cases} 2 & \text{if }u=(0,0)\\ 1 & \text{if }u=(0,1),\\ 5 & \text{if }u=(2,0),\\ 0 & \text{otherwise}, \end{cases}$$ and we can see that (as functions from $\mathbb{N}^2$ to $\mathbb{Z}$), $$\mathbf{F}=2+x_1+5x_2^2.$$