As part of lemma 6.4 in Hartshorne, I came across a statement that I can't prove
Let $m,n $ be maximal ideals of an integral domain $A$. Then $ A_m \subset A_n$ implies $n \subset m $.
It is clear intuitively. To prove it, I picked $s \in A-m$. Since $1/s\in A_m \subset A_n$, there is $a/t=1/s$ for $a\in A,t\in A-n$. This gives $as=t$. I don't know how to use this to show that $s\in A-n$.
I also wonder whether we can generalise this to any multiplicative sets or any rings (not domains).
Thank you