In a PID every nonzero prime ideal is maximal In a principal ideal domain, prove that every non trivial prime ideal is a maximal ideal
Attempt: Let $R$ be the principal ideal domain. A principal ideal domain $R$ is an integral domain in which every ideal $A$ is of the form $\langle a \rangle = \{ar~~ | ~~r \in R\}$
Let $ \langle a \rangle $ be a prime ideal $\implies R/A $ is an integral domain.
A finite integral domain is a field . Hence, if we prove that $R/A$ is finite, then $R/A$ is a field $\implies A$ is a maximal ideal.
Now, $\langle a \rangle = \{ar~~ | ~~r \in R\}$
Since, R is an integral domain, there are no zero divisors and cancellation is allowed $\implies ar_1 = ar_2 \implies r_1=r_2 \implies ar_i$ maps to a different member of $R$ for each different $r_i \implies \langle a \rangle$ represents the elements of $R$ in some random order.
$\implies \langle a \rangle = R$ and hence, $R/A \approx {0}$ is finite and hence $A$ is maximal.
Is my attempt correct?

To prove this we use that $PID$ are UFDs. Then Let $\mathfrak{p}=(p)$ be a prime ideal of $R$. Assume there is an ideal $\mathfrak{p}\subseteq\mathfrak{m}=(m)\subseteq R$. Then we would have that $m|p$, but then by the defintion of a prime element of a UFD this means that $m=p$ or $m=u$, a unit. Hence $\mathfrak{m}=(p)$ or $R$, proving maximality.
Edit: Since the op hasn't seen UFDs yet, here's a quick way around that:
Becaues $(p)\subseteq (m)$ we have that there is a $b\in R$ so that $ap=bm$ for every $ap\in (p)$. In particular $p=b_0m$. But then as $p$ is prime, either $m$ or $b_0$ must be a unit. the first case implies $\mathfrak{m}=R$ the second implies $\mathfrak{m}=\mathfrak{p}$, hence $\mathfrak{p}$ is maximal.
