TITLE: Show that $U \subset S$ open in S $\iff$ there exists an open set $U'$ in $X$ such that $U=U' \cap S $
QUESTION [5 upvotes]: Let X be a metric space and let $S\subset X$
I want to show that $U \subset S$ open in S $\iff$ there exists an open set $U'$ in $X$ such that $U=U' \cap S $
Here is a little bit of my reasonning: 
For $\implies$

$U$ is open in $S$, we simply have to set $U = U'$ and $U = U'\cap S$

For $\Longleftarrow$
If there exists an open set $U'$ in $X$ such that $U=U'\cap S$ then either: 

If S is closed then $U' \neq S$ but since U is an open subset of , $U' \subset S$ is also open in S. We simply have $U = U'$
If S is open we simply have $U' = S$ therefore $U = U'\cap S$ is open

Here is an image that might help you visualize the situation

My reasonning is not too rigorous, could someone help me improve it?

REPLY [3 votes]: Let $B_\epsilon(x,S)$ denote the open ball centered at $x$ with radius $\epsilon$ with respect to the topology on $S$ and define $B_\epsilon(x, X)$ analogously. 
($\Rightarrow$) If $U \subseteq S$ is open, then for all $x \in S$ there exists $\epsilon>0$ with $B_\epsilon(x, S) \subseteq U$. Note that $B_\epsilon(x,S)=B_\epsilon(x, X) \cap S$. Then $U= (\bigcup_{x \in S} B_\epsilon(x,X))\cap S$. The set at the left of the intersection is open in $X$ by definition.
($\Leftarrow$) Now suppose $U \subseteq S$, $U= U' \cap S$ for some open $U' \subseteq X$. Then for all $x \in U$ there exists $\epsilon>0$ such that $B_\epsilon(x, X) \subseteq U'$. Then $B_\epsilon(x,S)= B_\epsilon(x,X) \cap S \subseteq U$, i.e. since $x$ was arbitrary, $U$ is open in $S$.