Let $A$ be a commutative ring with unity, $S\subset A$ arbitrary and $g\in A$. I'm trying to prove the following result:
If for every prime ideal $\mathfrak{p}$ we have $$\mathfrak{p}\supset (S)\implies \mathfrak{p}\supset (S, g)$$
then $g\in(S)$, where $(C):=\left\{\sum_{i=1}^na_ic_i\mid a_i\in A, c_i\in C\right\}$.
I think this can be done by contradiction. Suppose $g\notin (S)$, then $(S)\subsetneq(S, g)$. By the property above, $\text{rad}((S, g))=\cap_{p\supset(S,g)}p=\cap_{p\supset(S)}p=\text{rad}((S))$. I'm trying to argue that the proper inclusion $(S)\subsetneq(S, g)$ implies $\text{rad}((S))\subsetneq\text{rad}((S, g))$, which gives us a contradiction. But I don't know how to formalize this step, in fact I'm not even sure it is true.
How do I resolve this?
[EDIT: the original problem I was given in class is this: Let $A$ be a ring, $g\in A$ and $S\subset A$. Let $U_g$ be the associated principal open subset of $\text{Spec}(A)$. Show that $U_g\subset \cup_{h\in S}U_h \iff g\in(S)$. Conclude that $\text{Spec}(A)$ is quasi-compact.]
I think the statement is false. Take $A=k[[x]]$, and $S=x^2$, $g=x$. There is an unique prime ideal containing $S$, which is $(x)$. However, $x$ is not in the ideal generated by $S$.