Applying Nakayama's lemma is giving me trouble Let $R$ be a noetherian commutative ring with unity, $I$ be a maximal ideal of $R$, and $R_I$ be the localization of the ring $R$ at $I$. I am having trouble understanding how the following follows from Nakayama's lemma (I'm using Atiyah Macdonald):

If the ideal $IR_I$ (also known as $I_I$) of the localization $R_I$ is zero, then there exists an element $a$ in $I$ such that $(a+1)I$ is zero.

 A: First, we have
$$(I/I^2)_I \cong I_I/I^2_I = 0$$
because $I_I = 0$.
Next, let $J \neq I$ be any other maximal ideal of $R$. Then pick some $s \in I \setminus J$ and let $x \in I_J$ be arbitrary. Write $x = \frac{a}{b}$ with $a \in I$ and $b \in R \setminus J$. Then also $x = \frac{sa}{sb}$ because still $sa \in I$ and $sb \in R \setminus J$. But also note that $\frac{sa}{sb}$ lies in the submodule $I^2_J \leq I_J$, because $sa \in I^2$. Since $x$ was arbitrary, we conclude that $I_J = I^2_J$, so
$$(I/I^2)_J \cong I_J/I^2_J = 0.$$
Since $J$ was arbitrary, we have just shown that $(I/I^2)_{\mathfrak{m}} = 0$ for all maximal ideals $\mathfrak{m}$ of $R$. Thus, $I/I^2 = 0$, i.e. $I = I^2 = II$.
But now, Nakayama's lemma says that there exists some $a \in I$ such that $(a+1)I = 0$, as desired! $\square$

Here was the thought process that led me to this proof:
The desired conclusion looks familiar. I know the following version of Nakayama's lemma:

If $R$ is a ring with an ideal $I$ and $M$ is a finitely generated $R$-module such that $IM = M$, then there exists some $a \in I$ such that $(a+1)M = 0$.

So, I ought to set $M = I$ in this case and try to prove that $I^2 = I$! This will be sufficient because the Noetherian assumption on $R$ tells us that $I$ is finitely generated as an $R$-module.
From there I noted that $I_I = I^2_I$ is easy to prove, because $I_I = 0$, so it would suffice to show that $I_J = I^2_J = 0$ for all maximal ideals $J \neq I$. This turned out to be straightforward to do.
