This is a question in Atiyah's commutative algebra book (Ch1 Ex.2), which was frequently asked before. I know how to solve it using the hint by inductively showing that $a_n^{r+1}b_{m-r}=0$. Now, I wonder whether it is possible to use the description of nilpotent ideals $\sqrt{(0)}=\bigcap_{\mathfrak{p}\text{ prime}}\mathfrak{p}$ to solve it. It proceeds like the following:

Assume that $f\in A[x]$ is a unit. Then there is some $g\in A[x]$ such that $f\cdot g=1$. Let $\mathfrak{p}$ be an arbitrary prime ideal of $A[x]$ and $A'[x]:=(A/\mathfrak{p})[x]\cong A[x]/\mathfrak{p}[x]$ is a domain. We have $\overline{f}\cdot\overline{g}=\overline{1}$ in $A'[x]$. Let $\overline{f}$ be $\overline{a_n}x^n+\cdots+\overline{a_1}x+\overline{a_0}$ and $\overline{g}$ be $\overline{b_m}x^m+\cdots+\overline{b_1}x+\overline{b_0}$. Then $$\overline{f}\cdot \overline{g}-\overline{1}=(\overline{f}-\overline{a_0})\cdot(\overline{g}-\overline{b_0})+\overline{b_0}\cdot\overline{f}+\overline{a_0}\cdot \overline{g}=\overline{0}.$$ I cannot continue from here, but enough to show that $\overline{a_n},\cdots,\overline{a_1}$ are zeros in $A/\mathfrak{p}$.

I will appreciate any help. Moreover, maybe the (incomplete) proof above can be further simpliefied even without writing coefficients in $f$ and $g$ explicitly.