I want to show that a ring in which every element is either a unit or nilpotent is a local ring
To prove this, I will show that the set of non-units form an ideal. If $n \in \mathfrak{m}$, then for any $r \in R$, I have to show that $rn, nr \in \mathfrak{m}$ If not then $rn, nr$ are invertible. Hence there exist elements $c,d \in R$ such that $crn=nrd=1$. Now note that $$(ncr)(ncr)=n(crn)cr=ncr$$ and $$(rdn)(rdn)=rd(nrd)n=rdn$$
Thus the elements $ncr, rdn$ are idempotents.
Now if $e$ is an idempotent, then $e(1-e)=0$. Here either $e$ is invertible then $(1-e)=0 \Rightarrow e=1$ else $e$ is nilpotent. Then $e=e^2=e^3= \dots e^k=0$ and hence $e=0$.
Thus $ncr=0,1$ but none of them are $0$ because $1=(crn)(crn)=cr(ncr)n$ and hence $ncr=1$ and we do the same for $nrd$
Hence $n$ is invertible leading to contradiction.
Is is correct way to show that the subset $\mathfrak{m}$ is closed under multiplication with elements of $R$?