How can I show some rings are local. I want to prove $k[x]/(x^2)$ is local. I know it by rather a direct way: $(a+bx)(a-bx)/a^2=1$. But for general case such as $k[x]/(x^n)$, how can I prove it?
Also for 2 variables, for example $k[x,y]/(x^2,y^2)$ (or more higher orders?), how can I prove they are local rings?
 A: A ring $R$ is local if and only if the associated reduced ring $R_{red} = R/Rad(0)$ is local. In both of your cases this latter ring is the field $k$, hence both of your rings are local. 
A: 
Let $R$ be a commutative ring and $I\subset R$ an ideal. If $\sqrt{I}\in\operatorname{Max}(R)$, then $R/I$ is a local ring of Krull dimension $0$.

Proof. Let $P\in\operatorname{Spec}(R/I)$. Then there is $\mathfrak{p}\in\operatorname{Spec}(R)$, $\mathfrak{p}\supseteq I$, such that $P=\mathfrak{p}/I$. Since $\sqrt{I}\subseteq\mathfrak{p}$ and $\sqrt{I}\in\operatorname{Max}(R)$ it follows that $\mathfrak{p}=\sqrt{I}$. Thus the only maximal ideal of $R/I$ is $\sqrt{I}/I$.
In your examples $\sqrt{(X^2)}=(X)$ is maximal in $K[X]$, and similarly $\sqrt{(X^2,Y^2)}=(X,Y)$ is maximal in $K[X,Y]$.
A: There are several other answers here, but you'll get another one.
Basic commutative algebra fact: the set of nilpotents $N$ is an ideal, and is equal to $\cap_{\mathfrak{p} \, \mathrm{prime}} \mathfrak{p}$, the intersection of all prime ideals in your ring.
Well, $x$ is nilpotent in your ring, so every prime ideal contains it(and so every maximal ideal contains it), but $(x)$ is maximal! Thus our ring is local.
A: You can use the following
Claim: A commutative unitary ring is local iff the set of non-unit elements is an ideal, and in this case this is the unique maximal ideal.
Now, in $\,k[x]/(x^n):=\{f(x)+(x^n)\;\;;\;\;f(x)\in K[x]\,\,,\,\deg(f)<n\}$ , an element in a non-unit iff $\,f(0)=a_0= 0\,$ , with $\,a_0=$ the free coefficient of $\,f(x)\,$, of course.
Thus, we can characterize the non-units in $\,k[x]/(x^n)\,$ as those represented by polynomials of degree less than $\,n\,$ and with free coefficient zero, i.e. the set of elements $$\,M:=\{f(x)+(x^n)\in k[x]/(x^n)\;\;;\;\;f(x)=xg(x)\,\,,\,\,g(x)\in k[x]\,\,,\deg (g)<n-1\}$$
Well, now check the above set fulfills the claim's conditions.
Note: I'm assuming $\,k\,$ above is a field, but if it is a general commutative unitary ring the corrections to the characterization of unit elements are minor, though important. About the claim being true in this general case: I'm not quite sure right now.
