Can we extend any metric space to any larger set? Let $(X,d)$ be metric space and $X\subset Y$. Can $d$ be extended to $Y^2$ so that $(Y,d)$ is a metric space?
Edit:
how about extending any $(\Bbb Z,d)$ to $(\Bbb R,d)$

Yes.  Pick any $x_* \in X$, and let $d_Y$ be any metric on $(Y \setminus X) \cup \{ x_* \}$.  We then define a metric $\hat{d}$ on $Y$ as follows: $$\hat{d} (x,y) = \begin{cases}
d ( x , y ), &\text{if }x,y \in X\\
d_Y (x,y), &\text{if }x,y \in ( Y \setminus X ) \cup \{ x_* \}\\
d ( x , x_* ) + d_Y (x_* , y ), &\text{if }x \in X, y \in(Y \setminus X ) \cup \{ x_*\} \\
d ( y , x_* ) + d_Y (x_* , x ), &\text{if }y \in X, x \in(Y \setminus X ) \cup \{ x_*\}
\end{cases}$$
Note: This is essentially a generalisation of Did's answer; he would take $d_Y$ as the usual discrete metric on my $( Y \setminus X ) \cup \{ x_* \}$.
