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?
 A: 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.
A: I add the following to answer @user364766's comment (my answer didn't fit in a comment). The answer I give works only when $\mathcal{G}$ is representable.
The general setting is the following. Let $\mathcal{G}$ be a (not necesarily representable) group scheme over $S$ and assume that you have a right action of $\mathcal{G}$ on an $S$-scheme $X$. Denote by $\mathrm{GL}(\mathcal{O}(X))$ the $S$-group scheme which sends an $S$-scheme $T$ to $\mathrm{GL}_{\mathcal{O}(T)}(\mathcal{O}(X_T))$.
Then, one may define a group scheme morphism $\rho:\mathcal{G}\rightarrow \mathrm{GL}(\mathcal{O}(X))$ in the following way: if $T$ is an $S$-scheme, $g\in \mathcal{G}(T)$ and $f\in\mathcal{O}(X_T)=\mathrm{Nat}(\mathrm{Hom}_T(-,X_T),\mathrm{Hom}_T(-,\mathbf{A}^1_T))$, then define $$g.f\in \mathcal{O}(X_T)=\mathrm{Nat}(\mathrm{Hom}_T(-,X_T),\mathrm{Hom}_T(-,\mathbf{A}^1_T))$$
by setting, for each $T$-scheme $T'$ and $x\in X(T')$ $$g.f(x)=f(x.g)$$where in the right handside of the equality, I have identified $g$ with its image in $\mathcal{G}(T')$.
Now, if $\mathcal{G}$ is representable, take $X=\mathcal{G}$ and make $\mathcal{G}$ act on $X$ on the right by translations: in this way, the morphism $\rho$ defined above is such that you retrieve the one defined by Milne when $S$ is the spectrum of a field.
