Separate open sets around distinct points in metric spaces 
Let $(X,d)$ be a metric space. Suppose $x \neq y$ and $x,y \in X$. Prove that there exist open sets $G_1$ and $G_2$ in $X$ such that $x\in G_1$ and $y \in G_2$ and $G_1 \cap G_2= \emptyset$.

Answer:
Here $x,y \in X$ and $x \neq y$, so $d(x,y)>0$.
Let $r=d(x,y)/2 >0$.
Then $S(x,r)$ and $S(y,r)$ are open spheres in $X$ and hence they are open sets in $X$.
Let $G_1=S(x,r)$ and $G_2=S(y,r)$.
Then $G_1 \cap G_2= \emptyset$.
(In this way I try to solve this question but I don't how to prove it is empty but clearly it is empty.
So please someone help me.)
 A: If there is some $z\in S(x,r)\cap S(y,r)$, then$$d(x,y)\leqslant d(x,z)+d(z,y)<2\times\frac12d(x,y)=d(x,y),$$which is impossible.
A: Assume that $G_1 \cap G_2 \ne \emptyset$. Then, $\exists a \in G_1 \cap G_2$, so $a \in G_1$ and $a \in G_2$.
Hence, $d(x,a) < r$ and $d(y,a) < r$, thus by Triangle inequality,
$$
d(x,y) < d(x,a) + d(a,y) < r + r = 2r = d(x,y),
$$
a contradiction.
A: Let $(X,d)$ be a metric space. Suppose $x \neq y$ and $x,y \in X$.
We wish to prove that there exist open sets $G_1$ and $G_2$ in $X$ such that $x \in G_1$ and $y \in G_2$ such that $G_1 \cap G_2 = \emptyset$.
Let us proceed as you started!
Here $x,y \in X$ and $x \neq y$ ,so $d(x,y)>0$.
Let $r =   d(x, y)$. Then $r > 0$. Define $r_1 = {r \over 2}$.
Clearly, $r_1 > 0$.
Then $B(x,r_1)$ and $B(y,r_1)$ are open spheres in $X$ and hence they are open sets in $X$.
Recall that
$$
B(x, r_1) = \{ z \in X : d(x, z) < r_1 \}
$$
$$
B(y, r_1) = \{ z \in X : d(y, z) < r_1 \}
$$
Clearly, $x \in B(x, r_1)$ as $d(x, x) = 0 < r_1$.
Clearly, $y \in B(y, r_1)$ as $d(y, y) = 0 < r_1$.
Obviously, $B(x, r_1)$ and $B(y, r_1)$ are open sets in $X$.
Furthermore, we wish to claim that $B(x, r_1) \cap B(y, r_1) = \emptyset$.
We prove this by a contradiction argument.
Suppose that $B(x, r_1) \cap B(y, r_1) \neq \emptyset$.
This means that there must exist $z \in B(x, r_1) \cap B(y, r_1)$.
Hence, $z \in B(x, r_1)$ and $z \in   B(y, r_1)$.
This implies that $d(x, z) < r_1$ and $d(y, z) < r_1$.
By triangle inequality, we conclude that
$$
r = d(x, y) \leq d(x, z) + d(z, y) = d(x, z) + d(y, z) < {r \over 2} +
{r \over 2} = r.
$$
Since we derived $r < r$, we got a contradiction.
This means that our supposition $B(x, r_1) \cap B(y, r_1) \neq \emptyset$ is wrong.
Hence, we showed that $B(x, r_1) \cap B(y, r_1) = \emptyset$.
Finally, if we define
$$
G_1 = B(x, r_1) \ \ \mbox{and} \ \ G_2 = B(y, r_1) \ \ \ \left[\mbox{Note:} \ r_1 = {r \over 2} = {d(x, y) \over 2} \right],
$$
then we showed that $x \in G_1, y \in G_2$, $G_1, G_2$ are open sets and $G_1 \cap G_2 = \emptyset$.
