Let us first give a definition:
Definition Given a metric space $X$, and a subset $Y\subseteq X$, we say a subset $E$ of $Y$ is open relative to $Y$ if for each $p\in E$ there is an associated real $r>0$ such that $q\in E$ whenever $d(p,q)<r$ and $q\in Y$.
Next, we state the theorem:
Theorem: Suppose $Y\subseteq X$. A subset $E$ of $Y$ is open relative to Y if and only if $E=Y\cap G$ for some open subset $G$ of $X$.
The proof provided in the book goes like this:
Proof Suppose $E$ is open relative to $Y$. To each $p\in E$ there is a positive number $r_p$ such that the condition $d(p,q)<r_p$, $q\in Y$ imply that $q\in E$. Let $V_p$ be the set of all $q\in X$ such that $d(p,q)<r_p$, and define: $$ G=\bigcup_{p\in E}{V_p}. $$ Then $G$ is an open subset of $X$, by Theorems 2.19 and 2.24 [which state that every neighbourhood is an open set, and every union of open sets is itself an open set]. since $p\in V_p$ for all $p\in E$ it is clear that $E\subseteq G\cap Y$.
So far so good. However, I could not understand why the next part of the proof is true:
By our choice of $V_p$, we have $V_p\cap Y \subseteq E$ for every $p\in E$, so that $G\cap Y \subseteq E$.
More specifically, why is it so clear that by our choice of $V_p$, we have $V_p\cap Y \subseteq E$ for every $p\in E$? As a 'counterexample', take: $$ \begin{align} X=&\mathbb{R}^2 \\ Y=&\{ (x,0) : x\in\mathbb{R} \} \cup \{ (x,\frac{1}{2}) : x\in\mathbb{R} \}& \\ E=&\{ (x,0) \in Y : -1<x<1 \} \\ V_{(0,0)}=&\{ (x,y) \in X : x^2+y^2\lt 1 \} \left(\text{a.k.a the unit ball}\right) \end{align} $$ Is my 'counterexample' correct? and if so, what is missing from the proof to make it work?