The regular representation for affine group schemes

I want to understand the regular representation of an affine algebraic group. An affine algebraic group as I know it, is a functor from the category of $k$ -algebras to groups that is representable when considered as a functor from $k$ algebras to sets. The coordinate ring $\mathcal{O} (G) = Nat (G,\mathbb{A}^1)$ where $\mathbb{A} ^1$ the functor from $k$-algebras to sets.

It is written in Milne's book on Affine Group Schemes that the regular representation may be defined such that for $g \in G(R)$, $f \in \mathcal{O} (G)$ and $x \in G(R)$, Then $(gf)_R (x) = f_R (xg)$.

I don't understand why this gives us another element in the coordinate ring (i.e. an element in $Nat(G,\mathbb{A}^1)$ ). For instance if we pick another algebra $Z$ what what is then $(gf)_Z (z)$ where $g\in G(R)$ and $z \in G(Z)$? Why is this data enough to give a linear representation?

-
I don't have time to write up the details right now, but you might be able to find more details in Jantzen's Representations of Algebraic Groups (at least I recall it having the details of this). – Tobias Kildetoft Jun 3 '13 at 0:05

The definition that Milne uses for a representation on $V$ is that it is a natural transformation of functors $$G \to \operatorname{End}(V)$$ such that the components $$G(R) \to \operatorname{End}_R(V \otimes_k R)$$ are homomorphisms. If $V = k[G]$ is the coordinate ring of a scheme then $V \otimes_k R = k[G] \otimes_k R = R[G]$ is the coordinate ring of the scheme $G_R$ obtained by restricting $G$ to $R$-algebras.
For you this means that the function $gf$ will lie in $R[G] = \operatorname{Nat}(G_R, \mathbb A^1_R)$, so in particular you only have to define it's value on elements $x \in G(A)$ where $A$ is an $R$-algebra.
To do this note that being an $R$-algebra means there is a ring homomorphism $R \to A$. Then $G$ being a functor we get a homomorphism $G(R) \to G(A)$ so we can push $g$ into $G(A)$ in order to multiply it with $x$. Then apply $f_A$ to the result.