We have that a commutative ring $R$ with $1$ is called local if $R − R^×$ is an ideal of $R$. I have to proof the following:
$R$ is local $\iff$ $R$ has exactly one maximal ideal.
We have that every ideal $I$ $\subseteq$ $R$ is contained in a unique maximal ideal. $R$ is local so that the only maximal ideal is $M$. So, $I$ $\subseteq$ $M$. The homomorphism $\phi$: $R$ $\rightarrow$ $R/I$ tells me that the ideals of $R/I$ are all contained in $\phi$(M). $\phi$(M) is a maximal ideal in $R/I$ so that it is also the unique maximal ideal in $R/I$ since any other maximal ideal is contained in it.
So, $R/I$ has a unique maximal ideal $\phi$(M) and hence it is local.
I am not sure if this is a complete proof of the above statement. Any help would be grateful.
Assume $R$ is local and let $M=R\setminus R^\times$. By assumption $M$ is an ideal. It is also maximal because any ideal which properly contains it must contain invertible elements and hence it is all $R$. Now let $I\subseteq R$ be any proper ideal. Then all the elements of $I$ must be non invertible and hence $I\subseteq M$. So this shows any proper ideal is contained in $M$, hence it must be the only maximal ideal of $R$.
Second direction: suppose there is exactly one maximal ideal and let's call it $M$. We will show that $M=R\setminus R^x$. Obviously $M\subseteq R\setminus R^x$. Now suppose there is a non invertible element $y\in R\setminus R^x$ such that $y\notin M$. Then define:
$I=\{ry: r\in R\}$
It is easy to see that $I$ is an ideal of $R$. It is also a proper ideal because $1\notin I$. (because $y$ is not invertible). Then $I$ is contained in some maximal ideal. Since by assumption $M$ is the only maximal ideal we must have $I\subseteq M$. But this means $y\in M$, a contradiction. Hence we must have $M=R\setminus R^x$, so $R$ is indeed local.