Let $A,B$ be two local rings and put $\mathfrak{m}_A, \mathfrak{m}_B$ their maximal ideals. Now suppose that we have an injection $0 \to A \to B$ and put $\mathfrak{n} := A \cap \mathfrak{m}_B $. It seems to me quite obvious that it should be $\mathfrak{m}_A = \mathfrak{n}$ (at least in the geometric way of thinking local rings). The question is if someone knows an example in which $\mathfrak{m}_A \supset \mathfrak{n}$ and $\mathfrak{m}_A \neq \mathfrak{n}$ or a proof of the equality which goes well in this general algebraic setting without refering to geometry; I found this problem in solving Liu's exercise in Algebraic Geometry and there all goes well thanks to the geometric assumptions that these rings are local rings of ringed topological space and that the ring $A$ is the universal quotient of $B$ by a $G$-action. Then I try to generalize this part of the proof but I lost myself.

Thank you