I have a question: Let R be an integral domain, if the only ideals are the trivial ideals, prove that R is a field.
So my proof for this was;
Let $a\in R$ be a non-zero element. Since we have that the only ideals are $(0)$ and $(1)$ we have that $a$ cannot be in $(0)$ since it's non-zero. Since $a$ isn't in $(0)$, it has to be in $(1)$ which implies that $a$ is a multiple of $1$ for some $b$ i.e. $ab = 1$
But this implies that $a$ is a unit so therefore $R$ is a field.
My professor told me there's a better way of doing this. Using the following theorem: Let $R$ be a ring that is commutative with identity and let $M$ be an ideal in $R$. Then $M$ is maximal iff $R/M$ is a field.
Personally, I have no idea how to use this theorem for this proof. It's obvious that $(0)$ is maximal so that means $R/(0)$ is a field. How do I go about showing R is a field using this?
This isn't valid as written: Since $a \in (1)$, it means that $a$ is a multiple of $1$, so that there exists $b \in R$ such that
$$a = 1 \cdot b$$
But we already knew that, since we can always choose $b = a$, so this doesn't tell us anything new. In general, $(1) = R$ always.
For a different way to proceed, consider the ideal $(a)$. You've already noted that $(a) \ne (0)$, so $(a) = (1)$. Now use this statement to find an inverse of $a$.
Alternatively, to use the theorem that your professor mentioned, note that $(0)$ is maximal, so that $R/(0)$ is a field; but $R/(0)$ is isomorphic to $R$.