Let $A$ be a domain with $\max(A)$ a finite set. It is known that if $\mathfrak{m}\in \max(A)$ then $A_{\mathfrak{m}}$ is a PID.
Show that $A$ is also a PID.
Here is what I was thinking. Suppose that $A$ is a local ring first. It is enough to show that every $\mathfrak{p}\in \text{spec}(A)$ is a principal ideal. We know, by hypothesis, $\mathfrak{p}'$ is a principal ideal where $\mathfrak{p}'$ denotes the image of $\mathfrak{p}$ under the localization map $A\to A_{\mathfrak{m}}$. Thus, we can write $\mathfrak{p}' = (\frac{a}{1})A_{\mathfrak{m}}$ for some $a\in A$. We claim that $\mathfrak{p} = (a)A$.
Let $x\in \mathfrak{p}$, since $\frac{x}{1}\in \mathfrak{p}'$ we can write $dx = ay$ for some $y\in A$ and $d\in A\setminus \{m\}$. Since $A$ is a local ring, and $d$ is not in the maximal ideal, $d$ is a unit, therefore $x = d^{-1}ay$. This shows that $\mathfrak{p}$ is generated by $a$.
What if $A$ is not a local ring? If we pick a prime ideal $\mathfrak{p}$ then we at least know there is a finite list of maximal ideals $\mathfrak{m}_i$ for $1\leq i\leq n$ which contain $\mathfrak{p}$. As before let us denote by $\mathfrak{p}_i$ to be the image of $\mathfrak{p}$ under the localization. We can write $\mathfrak{p}_i = ( \frac{a_i}{1}) A_{\mathfrak{m}_i}$ for some $a_i\in A$.
Therefore, for every $x\in \mathfrak{p}$, and every $1\leq i\leq n$, there exists $y_i\in A$ and $d_i \in A\setminus \{m_i\}$ such that $d_i x = a_i y_i$.
Now we have two issues. Even if we can somehow show that each $d_i$ is a unit then it will only show that $\mathfrak{p} = (a_1,a_2,...,a_n)$. The issue of "simplifying" this ideal all the way down to the form $(a)$ for some $a\in A$ is essentially asking for a gcd.
It feels like we need to use the Chinese Remainder Theorem here somehow but it is not clear to me how to apply it.