prove if $A\subset M$ is open and $B\subset A$, then $B$ is open in $A$ iff $B$ is open in $M$. Let $A$ be an open subset of a metric space $M$.
Prove that if $B\subset A$, then $B$ is open in $A$ if and only of $B$ is open in $M$.

$\Rightarrow $ $B$ is open in $A$, then $B$ is open in $M$.
proof. 
$B$ is open in $A$ $\Rightarrow $ there exists and open set, $G_M\subset M$, such that $G_M\bigcap A=B$.
What I need to show is that there exists an $r>0$, such that for any $x\in M$, open ball $B_M(x,r)\subset M$.

these are the information I have, but I do not know how to connect them. I need some help to prove this statement.
 A: From $G_M \cap A=B$: Let $x\in B$. Since $x\in A$ and $A$ is open in $M$, there exists $r_1>0$ s.t. $B_M(x;r_1)\subset A$. Since $x \in G_M$ and $G_M$ is open in $M$, there exists $r_2>0$ s.t. $B_M(x;r_2) \subset G_M$. Choose $r=\min\{r_1,r_2\}$. Then $B_M(x;r)\subset G_M$ and $B_M(x;r)\subset A$ so $B_M(x;r)\subset B$. This shows $B$ is open in $M$.
For the other direction, since $B\subset A$, we may write $B=B\cap A$. Since $B$ is open in $M$, we see that $B$ is open in $A$.
A: It may be worth noting that the result is true in any topological space, assuming we give $A$ the subspace topology induced by $M$ (which presumably is the hypothesis implicit in the OP's question): that is, the coarsest topology for which the inclusion $i_A:A\to M$ is continuous. 
For then, if $B$ is open in $M$ then, $i_A^{-1}(B)=B\cap A=B$ is open in $A$. 
On the other hand, if $B$ is open in $A$, there is an open $U\subseteq M$ such that $i^{-1}(U)=B$. But $i^{-1}(U)=A \cap U$ and by hypothesis, $A$ is open in $M$ so we have $B=A \cap U$ which is open in $M$, being the intersection of two sets that are open in $M$.
