I am going through the 'Algebraic Preliminaries' section from Algebraic Curves by William Fulton. I just want to make sure my algebra is not too rusty.
I saw a proof here (https://yutsumura.com/in-a-principal-ideal-domain-pid-a-prime-ideal-is-a-maximal-ideal/) but I want to check if mine also works. The main fact I'm making is every irreducible generates a principal ideal (perhaps this is wrong? It just seems obvious to me, and I didn't bother proving it independent yet).
Question: Let P be a nonzero, proper, prime ideal in R, where R is a PID. Show P is maximal.
Proof attempt: I shall perform proof by contradiction. Suppose P is not maximal. Then P $\subset$ I $\subset$ R, for some principal ideal I.
Let h be some element in R. If h is irreducible, it is contained in some principal ideal, and thus is also contained in I insofar as I is defined to be maximal.
If h is not irreducible, it can be expressed as a product of irreducibles (with will be unique up to ordering since a PID is also a UFD). Since, the ideals generated by each of these irreducibles are within I, each of these irreducibles are also within I, and thus can be expressed as a power of the irreducible generating I, h is also within I.
Such an argument can be used to place any element from R into I. Thus, R $\subset$ I. Obviously, I $\subset$ R, and so we have equality. In particular, P is maximal.
--
Thank you for your help!