Discriminant of a polynomial and Galois group I saw one statement: given an irreducible polynomial $f(x)\in\mathbb{Z}[x]$ of degree $n$, one can check whether the Galois group of $f(x)$ over $\mathbb{Q}$ is contained in $A_n$ or not by checking the discriminant of $f(x)$ is square or not. (see para after Theorem 2.2 in notes by Conrad)
I wanted to see the reason behind this fact; why the phenomena of square-non-square of  discriminant affects the containment of Galois group in $A_n$ or not? Can one explain the reason? One may suggest some standard reference for it.
 A: Let $\alpha_1,...,\alpha_n$ be all the complex roots of $f$. Since $f$ is irreducible we know it is separable, so all the roots are distinct. Now let $D=\prod_{i<j}(\alpha_i-\alpha_j)$. The discriminant of $f$ is exactly $D^2$. Now, let $\sigma$ be any permutation in the Galois group of $f$. It defines an automorphism on $\mathbb{Q}(\alpha_1,...,\alpha_n)$, and it satisfies:
$\sigma.D=\operatorname{sgn}(\sigma)\times D$
This follows exactly from the definition of sign of a permutation. Hence $\sigma.D=D$ if and only if $\sigma\in A_n\cap \operatorname{Gal}(\mathbb{Q}(\alpha_1,...,\alpha_n)/\mathbb{Q})$. From here the result easily follows. If $D\in\mathbb{Q}$ then any permutation in the Galois group must fix it, hence all such permutations are in $A_n$. The other direction: Assume $\operatorname{Gal}(\mathbb{Q}(\alpha_1,...,\alpha_n)/\mathbb{Q})\leq A_n$. Then every permutation in $\operatorname{Gal}(\mathbb{Q}(\alpha_1,...,\alpha_n)/\mathbb{Q})$ fixes $D$, hence $D$ belongs to the fixed field of $\operatorname{Gal}(\mathbb{Q}(\alpha_1,...,\alpha_n)/\mathbb{Q})$ which is $\mathbb{Q}$.
A: If $x_1,\ldots, x_n$ are the complex roots of $f$, then the square root of the discriminant is essentially the product of all $x_i-x_j$ and therefore flips sign when exactly two roots are swapped, or more generally, when any permutation $\notin A_n$ is applied to the roots. So if $G$ is not contained in $A_n$, $\sqrt D$ cannot be $G$-invariant.
