If X can be topologically embedded in a metric space Y how would one define the metric on X? I have an idea of how one might go about doing it, but it's never explicitly mentioned in the books or anywhere on the net for that manner (at least not where I looked which includes this site), so I just wanted to make sure. So suppose we have a homeomorphism $f$ of $X$ into $Y$ which is equipped with a metric $d$; how would one define the metric on $X$? And show that this metric induces the same original topology on $X$.
 A: Let $X$ be a topological space and $i: X\to Y$ a topological embedding into a metric space $(Y, d)$.
The most important thing to note is that $S$ is open in $X$ if and only if $f(S)$ is open in $Y$. Equivalently, $S$ is a neighborhood around $x\in X$ if and only if $f(S)$ is a neighborhood around $f(x)\in Y$.
Therefore, intuitively speaking, having an embedding means that we can effectively treat $X$ as a subspace of $Y$.
So to define a metric $\delta$ on $X$, we can transport our points to $Y$ and measure the distance there: $$
  \delta(x, x') := d(f(x), f(x')).
$$ Proving that this indeed is a metric is essentially just transporting the metric axioms on $Y$ through the injection $f$.
To show that the topology induced by $(X, \delta)$ is the same as the original one, we can just verify that the notion of „neighborhood“ is the same (as it is purely definable by the notion of open sets, hence only depends on the topology): note that the following are equivalent for $x\in X, S\subseteq X$:

*

*$S$ is a neighborhood around $x$

*$f(S)$ is a neighborhood around $f(x)$

*$f(S)$ contains an $\epsilon$-ball around $f(x)$ with regards to $d$

*$S$ contains an $\epsilon$-ball around $x$ with regards to $\delta$
Edit: Your title said „topological embedding“, and your post just spoke of „homeomorphic“. Therefore I chose to show the more general principle.
