Proof

If is a field, then there exists the zero ideal and the unit ideal, and these are different ideals. Let be an ideal in different from . Then contains some element , which is a unit. Therefore, and thus .

Suppose now that is a commutative ring with exactly two ideals. Then is not the zero ring. Let now be an element in different from . The principal ideal generated by , that is , is , and therefore it must be the other ideal, which is the unit ideal. In particular, this means . Hence, for some , so that is a unit.