Is every metric space a subspace of some connected metric space?

If we just want $(X,d)$ to be any subspace of a larger connected space, then sure: we don't even need metric then, just Tychonoff: every Tychonoff space embeds into a (connected) space $[0,1]^I$ for some set $I$.

If we want $X$ to be dense in the larger connected space $Y$, then $Y$ is called a connectification. In that case there are examples of metric spaces without a metric connectification (see the encyclopedia of general topology, chapter on connectifications), for references and some positive results as well.


In fact every metric space admits a canonical isometric embedding into a contractible metric space, as follows. If $X$ is a metric space, let $\hat{X}$ denote the space of weak contractions $X \to \mathbb{R}_{\ge 0}$, where a weak contraction $X \to Y$ between two metric spaces is a map $f : X \to Y$ such that $d_Y(f(x_0), f(x_1)) \le d_X(x_0, x_1)$. This space is a metric space when equipped with the sup norm

$$d_{\hat{X}}(f, g) = \sup_{x \in X} |f(x) - g(x)|.$$

There is a canonical embedding

$$X \ni x \mapsto (y \mapsto d(x, y)) \in \hat{X}$$

which one can straightforwardly verify is an isometry. This is a slight variant of the Yoneda embedding for metric spaces regarded as enriched categories.