does my proof on inverse functions make sense? I am proving this question:
let $g : N \rightarrow M$ and $ A \subseteq M$. Prove that if $f$ is surjective then $g(g^{-1}(A)) = A$
For the proof this is what I have said: 
(forwards)Let $y \in g(g^{-1}(A)) $, also lets say that $\exists x \in g^{-1}(A)$. Then by subjectivity $g(x) = y$. Then $g(x)=y \in A$. Wich leads to the conclution that $ g(g^{-1}(A)) \subseteq A$
(reverse) let  $y \in A$, also lets say that $\exists x \in N$, such that $g(x)=y\in A$.  This leads to $x \in g^{-1}(A)$ which is equivelent to $y = g(x) \in g(g^{-1}(A))$. This leads to the conclution that $A \subseteq g(g^{-1}(A))$
Hence   $g(g^{-1}(A)) = A$. 
Thanks for the help, any improvements welcome
 A: In "forward" you don't need surjectivity. If $y\in g(g^{-1}(A))$, that means that there exists $x\in g^{-1}(A)$ with $g(x)=y$. And $x\in g^{-1}(A)$ means that $g(x)\in A$; so $y=g(x)\in A$, and as $y$ was arbitrary we obtain that $g(g^{-1}(A))\subseteq A$. The way you wrote it, you don't say what $x$ is, and you wrote $D$ where you should have written $A$. 
It's in "reverse" where you need surjectivity. Given $y\in A$, there exists $x\in N$ with $g(x)=y$. So $x\in g^{-1}(A)$, and $y\in g(g^{-1}(A))$. Thus $A\subseteq g(g^{-1}(A))$.  The way you wrote it, I assume you were trying to say something like I said, but I cannot really follow your sentences; and you don't seem to have used surjectivity, which would make it wrong. 
To see that surjectivity is needed, one looks at the case where $g^{-1}(A)=\varnothing$. For instance let $g:\mathbb R\to\mathbb R$, $g(x)=1$. Take $A=[2,4]$. Then $g^{-1}(A)=\varnothing$, so $g(g^{-1}(A))\subsetneq A$. 
A: $x\in f^{-1}(A)\implies f (x)\in A $...  So  $f(f^{-1}(A))\subset A $...
Conversely, $\forall x\in A, \exists y\in N :f (y)=x $ (by surjectivity)...  That is : $y\in f^{-1}(A)$ .  So $x\in f(f^{-1}(A)) $.  Thus $A\subset f(f^{-1}(A)) $...
