The trick (which I failed to spot when I had to do this question in my exams last year) is to recall that free modules are flat.
Let $A = k [x_1, \ldots x_{n-1}]$ and $B = k [x_1, \ldots, x_n] / (f (x_1, \ldots, x_n))$. By the preparation lemma and a change of variables, we may assume $f (x_1, \ldots, x_n)$ is of the form $f(x_1, \ldots, x_n) = a_d {x_n}^{d} + \sum_{i=0}^{d-1} a_i(x_1, \ldots, x_{n-1}) {x_n}^i$ where $a_d$ is in $k$ and $a_i(x_1, \ldots, x_{n-1})$ is in $A$. It is then clear that an element of $B$ can always be written as $\sum_{i=0}^{d-1} c_i (x_1, \ldots, x_{n-1}) {x_n}^i \pmod{f (x_1, \ldots, x_n)}$ for some $c_i (x_1, \ldots x_{n-1})$ in $A$; thus, there is a surjective $A$-module homomorphism $p : A^{\oplus d} \to B$, and in particular $B$ is a finite $A$-module. Consider $\ker p$: suppose for $0 \le i < d$ we have elements $c_i (x_1, \ldots x_{n-1})$ of $A$, such that $\sum_{i=0}^{d-1} c_i (x_1, \ldots, x_{n-1}) {x_n}^i = g(x_1, \ldots, x_n) f(x_1, \ldots, x_n)$ for some $g(x_1, \ldots, x_n)$ in $k [x_1, \ldots, x_n]$. By considering the coefficient of the highest power of $x_n$ in $g (x_1, \ldots, x_n)$, we can show that $g = 0$. So in fact $\ker p = 0$, so $A^{\oplus d} \cong B$; in particular $B$ is a flat $A$-module.
Note that we didn't need to assume that $f (x_1, \ldots, x_n)$ is irreducible.