As mentioned in the comments, the solution given in the book is not correct. Let me reproduce it here:
Let $J$ be the Jacobson radical and $\mathfrak R$ be nilradical. Suppose $J\supsetneq\mathfrak R$. Then, it contains $x\in J\setminus\mathfrak R$ such that $x^n=x$ for some $n\in\mathbb N$. Now $x(1 − x^{n−1}) = 0$, and $1 − x^{n−1}$ has a form $1 + xy$ for some $y = −x^{n−1} \in A$, thus $1-x^{n-1}$ is a unit in $A$ by Proposition 1.9. Hence, $x=0$, contradiction. This implies $J=\mathfrak R$. It implies all prime ideals are maximal, otherwise $J\neq\mathfrak R$.
Everything up to the last sentence is correct, save for few typos. First, the clause "$x^n=x$ for some $n\in\mathbb N$" should instead be "$x^n=x$ for some integer $n>1$". Second, it should say "$1-x^{n-1}$" has the form $1-xy$, where $y=x^{n-2}$". Proposition 1.9 tells us that for all (commutative) rings $A$, and $x\in A$,
$$
x\in J\iff\forall y\in A(\text{$1-xy$ is a unit)} \, .
$$
Thus, the argument used to conclude that $J=\mathfrak R$ is fine.
However, showing that the nilradical and Jacobson radical coincide is not enough to conclude that every prime ideal is maximal. Indeed, as Alex Kruckman points out in the comments, if $k$ is a field, then the Jacoboson radical and nilradical of $k[x]$ both equal $(0)$ (the easiest way to show that the Jacobson radical equals $(0)$ is to appeal to Proposition 1.9). On the other hand, $(0)$ is prime (since $k[x]$ is an integral domain), but $(0)$ is not maximal (since $k[x]$ is not a field).
There are also a number of elementary arguments to establish the claim that you want, as mentioned in Rob Arthan's answer. Here is an alternative to what he suggested. Suppose $\mathfrak a\subset A$ is a prime ideal, and $x\not\in\mathfrak a$. It suffices to show that $\mathfrak a+(x)=(1)$. Let $n>1$ be an integer such that $x^n=x$. Then,
$$x^n-x=x(x^{n-1}-1)=0\in\mathfrak a \, ,$$
hence $x^{n-1}-1\in\mathfrak a$, and the result follows.