The following is from A. Białynicki-Birula, "Algebra" (the translation is mine).
Definition 10.12 Let, for every $k \in \mathbb{Z}$, $sgn(k)$ be equal $1$ if $k \ge 0$ and be equal $-1$ otherwise. Next, let use define for any mapping $\alpha \in S_n$, $n > 1$ $$Sgn(\alpha) = \prod_{\substack{i,k=1 \\ i<k}}^n sgn(\alpha(k) - \alpha(i)).$$
Theorem 10.13. For every natural number $n > 1$, $Sgn$ is a homomorphism of $S_n$ onto $\mu_2(Q)$.
Proof. It is easy to calculate that if $\beta \in S_n$ is a transposition of neighbouring elements, then $Sgn(\beta) = -1$. Let us establish the relationship between $Sgn(\alpha)$, $Sgn(\beta)$ and $Sgn(\alpha\beta)$ in the case when $\alpha$ is any element of the group $S_n$ and $\beta$ is a transposition of neighbouring elements $l$ and $l+1$. $$ Sgn(\alpha \cdot \beta) = \\= \prod_{\substack{i,k=1 \\ i<k}}^n sgn(\alpha\beta(k) - \alpha\beta(i)) = \\ = \prod_{\substack{i,k=1 \\ i<k,\ i,k \neq l,l+1}}^n sgn(\alpha\beta(k) - \alpha\beta(i)) \cdot sgn(\alpha\beta(l+1) - \alpha\beta(l)) \times \\ \times \prod_{i=1}^{l-1} sgn(\alpha\beta(l) - \alpha\beta(i)) \cdot \prod_{i=1}^{l-1} sgn(\alpha\beta(l+1) - \alpha\beta(i)) = \\ = \prod_{\substack{i,k=1 \\ i<k}}^n sgn(\alpha(k) - \alpha(i)) \cdot sgn(\alpha(l) - \alpha(l+1)) \cdot sgn(\alpha(l+1) - \alpha(l)) = \\ = -Sgn(\alpha) = Sgn(\alpha)*Sgn(\beta).$$ In the proof above we used the following equalities: $$sgn(\alpha(l+1)-\alpha(l))^2 = 1, \\ sgn(\alpha(l+1) - \alpha(l)) \cdot sgn(\alpha(l) - \alpha(l+1)) = -1 \\ Sgn(\beta) = -1.$$
- As I understand it, the author silently claims that $$\prod_{i=1}^{l-1} sgn(\alpha\beta(l) - \alpha(\beta(i)) \cdot \prod_{i=1}^{l-1} sgn(\alpha\beta(l+1) - \alpha\beta(i)) = sgn(\alpha(l+1) - \alpha(l)).$$ Is it really true? If yes, I'd find it rather surprising. Obviously we have: $$\prod_{i=1}^{l-1} sgn(\alpha\beta(l) - \alpha(\beta(i)) \cdot \prod_{i=1}^{l-1} sgn(\alpha\beta(l+1) - \alpha\beta(i)) = \\ = \prod_{i=1}^{l-1} sgn(\alpha(l+1) - \alpha(i)) \cdot \prod_{i=1}^{l-1} sgn(\alpha(l) - \alpha(i)),$$ but now we have analogous products in the expression behind the last "=" and if a factor in the first product equal -1, then $\alpha(l+1)$ being greater than $\alpha(l)$ does not imply anything about the analogous factor in the second product.
- Where did the author use the equality $sgn(\alpha(l+1)-\alpha(l))^2 = 1$?
Firstly it would be much easier to prove $${\rm Sgn}(\beta\alpha)={\rm Sgn}(\beta){\rm Sgn}(\alpha)$$ instead, which could be used to prove the theorem just as easily as ${\rm Sgn}(\alpha\beta)={\rm Sgn}(\alpha){\rm sgn}(\beta)$.
That is, the only factor in ${\rm Sgn}(\beta\alpha)$ that differs from the corresponding factor in ${\rm Sgn}(\alpha)$ is when $\{i,k\}=\{\alpha^{-1}(l),\alpha^{-1}(l+1)\}$, and those factors differ by a factor of $-1$.
However the author's proof is also correct. You are missing the change in indexing sets below the first products on the third and fifth line of the calculation. The author absorbs the two products on the fourth line of the equation into the first product on the fifth line, and multiplies by a factor of $1=({\rm sgn}(\alpha(l+1)-\alpha(l))^2$ (with one factor of $({\rm sgn}(\alpha(l+1)-\alpha(l))$ getting absorbed into the product).