TITLE: If a polynomial $g$ divides $f$ and $f'$, then $g^2$ divides $f$?
QUESTION [7 upvotes]: Here's a homework problem from Artin's Algebra that I'm having a lot of trouble with

Let $f(x) \in F[x]$ (where $F$ is a field of characteristic $0$).  If $g$ is an irreducible polynomial that is a common divisor $f$ and $f'$, then $g^2$ divides $f$ (where $f'$ denotes the derivative of $f$ in $F[x]$).

Let $K$ be an extension of $F$ such that $f$ splits completely in $K$.  So we can write $f(x) = \prod_{i=1}^n (x - \alpha_i)$ for some $\alpha_i \in K$.  Because $g$ divides $f$ in $F[x]$, we know that $g$ divides $f$ in $K[x]$.  Since $g$ divides $f$ we can write $g(x) = \prod_{j=1}^m (x - \alpha_{i_j})$.  Because $g$ is a common divisor of $f$ and $f'$, the roots $\alpha_i$ have some multiplicity greater than $1$, so that $(x - \alpha_i)^2$ divide $f$ for each $i$ (**).  Then $g^2$ divides $f$.
I think this is the right idea, although it feels like there are some holes in the argument (specifically the sentence marked with (**) at the end).  I also don't think I used the assumption that $g$ is irreducible.  Does this look OK?

REPLY [4 votes]: There are already good answers to the actual question but let me show why characteristic zero is required for the exercise.   
Let $F$ be an imperfect field of characteristic $p\gt 0$ and let $a\in F$ be an element which is not the $p$-th power of an element of $F$: in other words $a\in F\setminus F^p$.
The polynomial $f(x)=g(x)=x^p-a\in F[x]$ is then irreducible (see here) .
But although $g$ divides $f$ (since $g=f$) and also divides $f'$ (since $f'=0$), $g^2=f^2$ does not divide $f$: the statement in the exercise fails in positive characteristic.