Localization at a Maximal Ideal While studying, I came across this question:

If $A$ is a ring in which $x^n=x$ for all $x\in A$ (where $n$ is an integer greater than $1$ and may depend on $x$), show all prime ideals are maximal.

I didn't find the solution too hard (if it is correct). We let $P$ be a prime ideal. That $A/P$ is an integral domain; if we can show it is also a field, we'll know that $P$ is maximal. To that end, we know $a^n+P=a+P$, and in particular, $(a+P)(a^{n-1}+P)=(a+P)(1+P)$. Since we're in an integral domain, the cancellation law applies, so we have $(a^{n-1}+P)=(1+P)$. Now we have $(a+P)(a^{n-2}+P)=(1+P)$, hence $(a+P)$ has an inverse, so $A/P$ is a field.
The next question has me confused, though:

Let $\mathbf{m}$ be a prime ideal in a ring in which $x^n=x$ for all $x\in A$ (where $n$ is an integer greater than $1$ and may depend on $x$). Show that $A_\mathbf{m}$ is a field.

It seems like $A_\mathbf{m}$ should not be a field since $\frac{m}{1}$, $m\in\mathbf{m}$ wouldn't have an inverse, thus it would have to be in the equivalence class of $\frac{0}{1}$, but I don't see why that is true (if it indeed is true). Please help clear this up for me!

Let $x\in \mathfrak{m}$ and let $n$ be such that $x^n=x$. Then $x^{n-1}-1$ is not in $\mathfrak{m}$ because this would imply that $1\in\mathfrak{m}$ which is imposible since $\mathfrak{m}$ is a prime ideal. But $(x^{n-1}-1)x=0$ and this implies that $x/1=0$ by definition of $A_\mathfrak{m}$.
