[step:Exhibit a polynomial $f \in \mathbb{Q}[x]$ of degree $n$ with Galois group $S_n$]
We show that the generic polynomial of degree $n$ over $\mathbb{Q}$ has Galois group $S_n$. Consider the polynomial ring $\mathbb{Q}(t_1, \dots, t_n)[x]$ with indeterminate coefficients, and define
\begin{align*}
f(x) = \prod_{i=1}^{n}(x - t_i) = x^n - e_1 x^{n-1} + e_2 x^{n-2} - \cdots + (-1)^n e_n \in \mathbb{Q}(e_1, \dots, e_n)[x],
\end{align*}
where $e_1, \dots, e_n$ are the elementary symmetric polynomials in $t_1, \dots, t_n$. Let $k = \mathbb{Q}(e_1, \dots, e_n)$ and $K = \mathbb{Q}(t_1, \dots, t_n)$. Then $K$ is the splitting field of $f$ over $k$, since $f$ splits completely in $K$ as $\prod_{i=1}^n (x - t_i)$, and $K$ is generated over $k$ by the roots $t_1, \dots, t_n$.
[claim:$\operatorname{Gal}(K/k) \cong S_n$]
The Galois group of $K = \mathbb{Q}(t_1, \dots, t_n)$ over $k = \mathbb{Q}(e_1, \dots, e_n)$ is isomorphic to $S_n$.
[/claim]
[proof]
Every $\sigma \in \operatorname{Gal}(K/k)$ is a $k$-automorphism of $K$ that fixes $k$ pointwise. Since $\sigma$ fixes $k = \mathbb{Q}(e_1, \dots, e_n)$, it fixes every elementary symmetric polynomial $e_j(t_1, \dots, t_n)$. The roots of $f$ in $K$ are $t_1, \dots, t_n$, and $\sigma$ must permute them (because $\sigma$ fixes the coefficients of $f$ and hence maps roots to roots). This defines an injective group homomorphism
\begin{align*}
\Phi: \operatorname{Gal}(K/k) &\to S_n \\
\sigma &\mapsto \text{the permutation } \pi \text{ such that } \sigma(t_i) = t_{\pi(i)}.
\end{align*}
The map $\Phi$ is injective because a $k$-automorphism of $K = k(t_1, \dots, t_n)$ is determined by its action on the generators $t_1, \dots, t_n$.
For surjectivity, observe that every permutation $\pi \in S_n$ induces a $\mathbb{Q}$-automorphism $\sigma_\pi$ of $\mathbb{Q}(t_1, \dots, t_n)$ defined by $\sigma_\pi(t_i) = t_{\pi(i)}$. This is well-defined because $t_1, \dots, t_n$ are algebraically independent over $\mathbb{Q}$, so any permutation of them extends to a unique $\mathbb{Q}$-automorphism of the rational function field. Moreover, $\sigma_\pi$ fixes every symmetric polynomial in $t_1, \dots, t_n$, so $\sigma_\pi$ fixes $k = \mathbb{Q}(e_1, \dots, e_n)$ and hence $\sigma_\pi \in \operatorname{Gal}(K/k)$.
Therefore $\Phi$ is an isomorphism and $\operatorname{Gal}(K/k) \cong S_n$.
[/proof]
To produce a concrete polynomial over $\mathbb{Q}$ (rather than over the function field $k$), one specialises the indeterminate coefficients. For any $n \ge 5$, there exist infinitely many specialisations $e_i \mapsto a_i \in \mathbb{Q}$ such that the resulting polynomial $f(x) = x^n - a_1 x^{n-1} + \cdots + (-1)^n a_n \in \mathbb{Q}[x]$ has Galois group $S_n$ over $\mathbb{Q}$. This follows from Hilbert's irreducibility theorem, which states that if $f(x) \in k(t_1, \dots, t_n)[x]$ is irreducible over $k = \mathbb{Q}(e_1, \dots, e_n)$, then for all but finitely many (in a density-zero set of) specialisations $e_i \mapsto a_i \in \mathbb{Q}$, the specialised polynomial remains irreducible with the same Galois group. The hypothesis of Hilbert's theorem is satisfied: $f(x) = \prod_{i=1}^n (x - t_i)$ is irreducible over $k$ because its splitting field $K/k$ has degree $[K:k] = |S_n| = n!$, so $f$ has no root in $k$ (any root would be a $t_i$, but $t_i \notin \mathbb{Q}(e_1, \dots, e_n)$ since the extension is non-trivial). Therefore infinitely many specialisations yield polynomials in $\mathbb{Q}[x]$ with Galois group $S_n$.
Alternatively, for $n = 5$, the polynomial $g(x) = x^5 - 4x + 2 \in \mathbb{Q}[x]$ has Galois group $S_5$ over $\mathbb{Q}$. First, $g$ is irreducible over $\mathbb{Q}$ by the Eisenstein criterion with $p = 2$: the prime $2$ divides all non-leading coefficients ($0, 0, 0, -4, 2$), and $2^2 = 4$ does not divide the constant term $2$. Second, we verify that $\operatorname{Gal}(g/\mathbb{Q}) = S_5$ by reduction modulo primes:
- **Modulo $3$:** $g(x) \equiv x^5 - x + 2 \pmod{3}$. This factors as $(x^2 + x + 2)(x^3 + 2x^2 + 2) \pmod{3}$, where both factors are irreducible over $\mathbb{F}_3$. The Frobenius element at $p = 3$ has cycle type $(2, 3)$, so $\operatorname{Gal}(g/\mathbb{Q})$ contains a permutation with cycle structure $(2,3)$.
- Cubing the element of cycle type $(2, 3)$ yields a transposition in $\operatorname{Gal}(g/\mathbb{Q})$. Since $g$ is irreducible, $\operatorname{Gal}(g/\mathbb{Q})$ acts transitively on the five roots, so $5 \mid |\operatorname{Gal}(g/\mathbb{Q})|$, and by Cauchy's theorem the Galois group contains an element of order $5$, which must be a $5$-cycle. A transitive subgroup of $S_5$ containing both a transposition and a $5$-cycle equals $S_5$.[/step]