### Local ring proof

A local ring is commutative with identity which has a unique maximal ideal. Prove that R is local if and only if the non-units of R form an ideal. I need a detailed, rigorous proof of this with explanation of the steps so I can learn. Thank you.