Union of metric spaces Is the union of two metric spaces a metric space?
I tried it but could't define a suitable metric on intersection. Can somebody help me to understand it?

(1). If $(X_1,d_1), (X_2,d_2)$ are metric spaces and $X_1\cap X_2=\emptyset$ we can define a metric $d_3$ on $X_1\cup X_2$ by $d_3(x_1,x_2)=1$ when $x_1\in X_1 ,x_2\in X_2,$ and $d_3(x,y)=d_1(x,y)$ when $x,y\in X_1,$ and $d_3(x,y)=d_2(x,y)$ when $x,y\in X_2.$ Then the subspace topologies on $X_1$ and $X_2,$ as subspaces of $X_1\cup X_2,$ co-incide with their topologies induced by $d_1$ and $d_2.$
(2). If $X_1\cap X_2 \ne \emptyset$ this may not be possible. Example: For $j\in \{1,2\}$ let $$X_j=(\mathbb Q\times \{0\})\cup ((\mathbb R \backslash \mathbb Q)\times \{j\}), $$ and let $d_j((x,u),(y,v))=|x-y|$ for $(x,u),(y,v)\in X_j.$ Note that each $X_j$ is an isometric copy of $\mathbb R.$
Suppose $T$ is a topology on $X_1\cup X_2$ such that the subspace topologies on $X_1$ and $X_2$ are generated by the metrics $d_1,d_2.$ 
Let $(q_n)_{n\in \mathbb N}$ be a  sequence in  $\mathbb Q$ with $\lim_{n\to \infty}|q_n-\sqrt 2|=0.$
Consider any $U_1, U_2\in T$  such that $(\sqrt 2,1)\in U_1$  and $ (\sqrt 2,2)\in U_2.$
For $j\in \{1,2\}$ the set $U_j\cap X_j$ is a nbhd of $(\sqrt 2,j)$ in the space $X_j,$ and  $\lim_{n\to \infty}d_j((\sqrt 2,j)(q_n,0))=\lim_{n\to \infty}|\sqrt 2 -q_n|=0.$
Therefore, for $j\in \{1,2\}$ the set $\{n\in \mathbb N: (q_n,0)\not \in U_j\cap X_j\}$ is finite, so $\{n\in \mathbb N:q_n \not \in U_j\}$ is finite. So $q_n\in U_1\cap U_2$ for all but finitely many $n\in \mathbb N.$
So it is not possible that $U_1\cap U_2=\emptyset.$ So the points $(\sqrt 2,1) ,(\sqrt 2,2)$ do not have disjoint nbhds in $X_1\cup X_2.$ So the topology $T$ on $X_1\cup X_2$ is not Haudorff, and cannot be generated by a metric. 
Remark: There does exist a non-Hausdorff topology $T$ on $X_1\cup X_2$ such that the subspace topologies on $X_1$ and $X_2$, as subspaces of $X_1\cup X_2,$ are generated by the metrics $d_1,d_2.$ 
