Basic exercise on localization of modules

Solution 1:

I think, the key insight is that for $S=A\setminus \mathfrak{m}$ we have that $S^{-1}(A/\mathfrak{m}^n)=A/\mathfrak{m}^n$.