Let R be an integral domain. Show that if the only ideals in R are {0} and R itself, R must be a field I know that if (x)={0} then the if 0=r0 such that r belongs to R therefor it's a field.
Most likely I'm wrong but I need help with the second part if the ideal is R

If $R$ with unit.
Let $0\neq x\in R$ then $ 0\neq ( x)$ is an ideal of $R$ , hence $(x)=R$ so there exists $a$ in $R$ sush that $ax=1$.
