I am having a hard time understanding a simple theorem in Hardy's "An Introduction to the Theory of Numbers":
Let $f(x)$ and $g(x)$ be integral polynomials. If $p$ is a prime and $f(x)g(x)\equiv 0 \pmod {p^a}$ and $f(x) \not\equiv 0 \pmod p$, then $g(x)\equiv 0 \pmod {p^a}$.
The proof is very simple when $a=1$. The proof in the book proceeds by forming "$f_1(x)$ from $f(x)$ by rejecting all terms of $f(x)$ whose coefficients are divisible by $p$, and $g_1(x)$ similarly. If $f(x)\not\equiv 0$ and $g(x)\not\equiv 0$, then the first coefficient in $f_1(x)$ and $g_1(x)$ are not divisible by $p$, and therefore the first coefficient in $f_1(x)g_1(x)$ is not divisible by $p$. Therefore, $f(x)g(x) \equiv f_1(x)g_1(x) \not\equiv 0 \pmod p$."
The problem is the author then says by rejecting multiples of $p^a$ from $g(x)$ instead, we get the general result in the same way. This is where I do not understand the proof.
In the case of $a=1$, the whole question is essentially in modulo $p$, so one can reject the coefficients divisible by $p$. However, in the general case, I think one cannot reject multiples of $p$ from $f(x)$ because the resulting equation should be in modulo $p^a$.
For example, let $c_0$ be the first coefficient in $f(x)$ not divisible by $p$, and $d_0$ be the first coefficient in $g(x)$ not divisible by $p^a$. Then $c_0d_0$ is indeed not divisible by $p^a$. But the coefficients of $f(x)$ in front of $c_0$ and those of $g(x)$ behind $d_0$ can contribute to the total sum of the coefficient of the corresponding degree. Say, $p=3$, $a=2$, $f(x)=3x^2 + x$, $g(x)=6x + 1$, then $f(x) \not\equiv 0 \pmod p$, $g(x) \not \equiv 0 \pmod {p^a}$, $c_0=1$, $d_0=6$ but the coefficient of $x^2$ is $9$, so the same proof strategy does not work anymore although $f(x)g(x) \not\equiv 0 \pmod {p^a}$ indeed.
My question is then, what I should add in order to amend the proof? Any help would be greatly appreciated.
To prevent the question from not being answered and to help those who might have stumbled on the problem, here is the solution:
Use induction on $a$. $a=1$ has been already provided. Now suppose $g\equiv 0 \pmod {p^a}$, then one can see the same argument I used to provide a fallacy in the original proof does not work anymore, hence $g\equiv 0 \pmod {p^{a+1}}$.