Symmetric Group Action on a Set of Functions I'm not understanding the following passage and I'm hoping someone could elucidate (for context, this is in the lead up to the definition of the sign of a permutation) where the author says:

Let $f$ be a function of $n$ variables, say $f\space\colon\mathbb{Z}^n\to\mathbb{Z}$, so we can evaluate $f\left(x_1,\ldots,x_n\right)$. Let $\sigma$ be a permutation of $J_n$ (the author previously defined $J_n=\left\{1,\ldots,n\right\}$). We define the function $\pi\left(\sigma\right)f$ by $$\pi\left(\sigma\right)f\left(x_1,\ldots,x_n\right)=f\left(x_{\sigma\left(1\right)},\ldots,x_{\sigma\left(n\right)}\right).$$
  Then for $\sigma,\tau\in{S_n}$ we have $\pi\left(\sigma\tau\right)=\pi\left(\sigma\right)\pi\left(\tau\right)$. Indeed, we use the definition applied to the function $g=\pi\left(\tau\right)f$ to get
  \begin{align*}
\pi\left(\sigma\right)\pi\left(\tau\right)f\left(x_1,\ldots,x_n\right)&=\left(\pi\left(\tau\right)f\right)\left(x_{\sigma\left(1\right)},\ldots,x_{\sigma\left(n\right)}\right)\\
&=f\left(x_{\sigma\tau\left(1\right)},\ldots,x_{\sigma\tau\left(n\right)}\right) \\
&=\pi\left(\sigma\tau\right)f\left(x_{1},\ldots,x_{n}\right).
\end{align*}
  Since the identity in $S_n$ operates as the identity on functions, it follows that we have obtained an operation of $S_n$ on the set of functions. 

Now if I let $G$ be the set of functions $\mathbb{Z}^n\to\mathbb{Z}$, then I agree  the mapping $S_n\times G\to G$ defined by $\left(\varpi,f\left(x_1,\ldots,x_n\right)\right)\mapsto{f\left(x_{\varpi\left(1\right)},\ldots,x_{\varpi\left(n\right)}\right)}$ is well-defined since functions are well-defined, by definition.
Where I get lost is (and let me note how pleased I am that the align* environment works)
\begin{align*}
\pi\left(\sigma\right)\pi\left(\tau\right)f\left(x_1,\ldots,x_n\right)&=\left(\pi\left(\tau\right)f\right)\left(x_{\sigma\left(1\right)},\ldots,x_{\sigma\left(n\right)}\right)\\
&=f\left(x_{\sigma\tau\left(1\right)},\ldots,x_{\sigma\tau\left(n\right)}\right) \\
&=\pi\left(\sigma\tau\right)f\left(x_{1},\ldots,x_{n}\right).
\end{align*}
I would go about it as
\begin{align*}
\pi\left(\sigma\right)\pi\left(\tau\right)f\left(x_1,\ldots,x_n\right)&=\pi\left(\sigma\right)f\left(x_{\tau\left(1\right)},\ldots,x_{\tau\left(n\right)}\right)\\
&=f\left(x_{\sigma\tau\left(1\right)},\ldots,x_{\sigma\tau\left(n\right)}\right) \\
&=\pi\left(\sigma\tau\right)f\left(x_{1},\ldots,x_{n}\right).
\end{align*}
I'm not sure why the author used $\left(\pi\left(\tau\right)f\right)$ in the RHS of the first line of the aligned equation instead of  $\left(\pi\left(\tau\right)f\left(x_{\sigma\left(1\right)},\ldots,x_{\sigma\left(n\right)}\right)\right)$ and I don't follow why the $\pi(\sigma)$ term 'acts' first. I get why we can take out $\sigma\tau$ since function composition is associative, thus, $(\sigma\circ\tau)(1)=\sigma(\tau(1))$.
 A: I find your argument far easier to follow, but I believe that I understand the author's argument as well. And it's typical of these permutation things, which always mess me up. :(
Let's suppose that $\sigma$ sends $(1, 2, 3)$ to $(2, 3, 1)$, i.e., $\sigma(1) = 2; \sigma(2) = 3, \sigma(3) = 1$, (so $\sigma$, in my head, stands for "shift") and that $\tau$ sends $(1, 2, 3)$ to $(2, 1, 3)$ (so $\tau$ stands for "transpose").  
Now let's follow through the author's statements one by one, in this context. (Note that $\sigma$ and $\tau$ do not commute, so we'll be able to check that things came out right!)
\begin{align*}
\left((\pi\left(\sigma\right)\pi\left(\tau\right)\right)f\left(x_1,\ldots,x_n\right)&=\left(\pi\left(\tau\right)f\right)\left(x_{\sigma\left(1\right)},\ldots,x_{\sigma\left(n\right)}\right)\\
&=\left(\pi\left(\tau\right)f\right)\left(x_2,x_3, x_1\right)
\end{align*}
What's going on here is that the author is applying $\pi(\sigma)$ to the function $\pi(\tau)f$. To do so, on the RHS he must apply $\pi(\tau)f$ to the permuted $x$s. That is, he must apply $\pi(\tau)f$ to $x_2, x_3, x_1$. Now he wants to further expand that expression, and writes (I'm translating to concrete indices here)
\begin{align*}
\left(\pi\left(\sigma\right)\pi\left(\tau\right)\right)f\left(x_1,x_2,x_3\right)&=\left(\pi\left(\tau\right)f\right)\left(x_{2},x_3,x_1\right)\\
&=f\left(\text{something}\right)
\end{align*}
But what should the "something" be? We have to apply the permutation $\sigma$ to the numbers $x_2, x_3, x_1$, which converts them to $x_3, x_2, x_1$.
Now if you're like me, you wanted to say "Well, just apply $\sigma$ to each of the numbers $2, 3, 1$". But that results in $1, 3, 2$. That's not what we want. The problem is that we need to swap the first and second arguments, and the way to do that is to swap the numbers to which $\sigma$ was applied in the first place! In other words, we need 
\begin{align*}
\pi\left(\sigma\right)\pi\left(\tau\right)f\left(x_1,x_2,x_3\right)&=\left(\pi\left(\tau\right)f\right)\left(x_{2},x_3,x_1\right)\\
&=f\left(x_{\sigma(\tau(1)}, x_{\sigma(\tau(3)}, x_{\sigma(\tau(3)}\right)
\end{align*}
which turns out to be
\begin{align*}
f\left(x_{\sigma(\tau(1))}, x_{\sigma(\tau(2))}, x_{\sigma(\tau(3))}\right)
&= f\left(x_{\sigma(2)}, x_{\sigma(1)}, x_{\sigma(3)}\right)\\
&= f\left(x_3, x_2, x_1\right)
\end{align*}
as desired. 
I hope this helps. The short form is "all permutation stuff is either $ab$ or $ba$, and you can usually work out which with a simple example in $S_3$." 
A: One pair of parentheses will make things clearer (hopefully):
\begin{align*}
\pi\left(\sigma\right)\pi\left(\tau\right)f\left(x_1,\ldots,x_n\right)&=\pi(\sigma)\Bigl(\pi(\tau)f\Bigr)(x_1,\dots,x_n)\\
&=\left(\pi\left(\tau\right)f\right)\bigl(x_{\sigma\left(1\right)},\ldots,x_{\sigma\left(n\right)}\bigr).
\end{align*}
Now let $\Sigma$ be the $n$ by $n$ permutation matrix associated with $\sigma$.You can rewrite $\bigl(x_{\sigma\left(1\right)},\ldots,x_{\sigma\left(n\right)}\bigr)$ as $(x_1,\ldots,x_n)\Sigma$. So $$\pi\left(\sigma\right)f\left(x_1,\ldots,x_n\right)=f\bigl((x_1,\ldots,x_n)\Sigma\bigr).$$
If $T$ is the permutation matrix associated with $\tau$, we can end the above computation thus:
\begin{align}
\left(\pi\left(\tau\right)f\right)\bigl(x_{\sigma\left(1\right)},\ldots,x_{\sigma\left(n\right)}\bigr)&=\left(\pi\left(\tau\right)f\right)\bigl((x_1,\ldots,x_n)\Sigma\bigr)\\
&= f\Bigl(\bigl((x_1,\ldots,x_n)\Sigma\bigr)T\Bigr)=f\bigl((x_1,\ldots,x_n)\Sigma T\bigr)\\
&=\pi(\sigma\tau)f(x_1,\dots,x_n).
\end{align}
