[proofplan]
We prove directly that the corestricted map $f:X\to f(X)$ is bijective, continuous, and has continuous inverse. Distance preservation gives injectivity because points at zero distance in a [metric space](/page/Metric%20Space) are equal, while surjectivity onto $f(X)$ is built into the definition of the image. The inverse map is then defined by sending each point $f(x)\in f(X)$ back to its unique preimage $x$, and the same distance-preservation identity shows that this inverse is an isometry, hence continuous.
[/proofplan]
[step:View the image as a metric subspace of $Y$]
Let $d_{f(X)}:f(X)\times f(X)\to [0,\infty)$ denote the restricted metric defined by
\begin{align*}
d_{f(X)}(y,y'):=d_Y(y,y')
\end{align*}
for all $y,y'\in f(X)$. The topology induced by $d_{f(X)}$ is precisely the [subspace topology](/page/Subspace%20Topology) on $f(X)$ inherited from $Y$.
[/step]
[step:Prove that the corestricted map is bijective]
Regard $f$ as the corestricted map
\begin{align*}
f:X\to f(X).
\end{align*}
It is surjective by the definition of $f(X)$: for every $y\in f(X)$, there exists $x\in X$ such that $y=f(x)$.
To prove injectivity, let $x,x'\in X$ and suppose $f(x)=f(x')$. Then
\begin{align*}
d_X(x,x')=d_Y(f(x),f(x'))=d_Y(f(x),f(x))=0.
\end{align*}
Since $d_X$ is a metric, $d_X(x,x')=0$ implies $x=x'$. Hence $f:X\to f(X)$ is injective, and therefore bijective.
[/step]
[step:Show that the corestricted map is continuous]
For all $x,x'\in X$, the restricted metric satisfies
\begin{align*}
d_{f(X)}(f(x),f(x'))=d_Y(f(x),f(x'))=d_X(x,x').
\end{align*}
Thus the corestricted map $f:(X,d_X)\to (f(X),d_{f(X)})$ is an isometry. By [citetheorem:8702], every isometry between metric spaces is continuous, so $f:X\to f(X)$ is continuous.
[/step]
[step:Define the inverse map and prove it is an isometry]
Since $f:X\to f(X)$ is bijective, define the inverse map
\begin{align*}
g:f(X)\to X, \qquad g(y)=\text{the unique }x\in X\text{ such that }f(x)=y.
\end{align*}
The uniqueness used in this definition is exactly the injectivity proved above.
Let $y,y'\in f(X)$. By definition of $f(X)$, choose $x,x'\in X$ such that $y=f(x)$ and $y'=f(x')$. Then $g(y)=x$ and $g(y')=x'$, so distance preservation for $f$ gives
\begin{align*}
d_X(g(y),g(y'))=d_X(x,x')=d_Y(f(x),f(x'))=d_Y(y,y')=d_{f(X)}(y,y').
\end{align*}
Therefore $g:(f(X),d_{f(X)})\to (X,d_X)$ is an isometry.
[guided]
We now construct the inverse carefully, because this is the point where injectivity is needed. Since $f:X\to f(X)$ is surjective, every $y\in f(X)$ has at least one preimage $x\in X$ with $f(x)=y$. Since $f$ is injective, this preimage is unique. Therefore the formula
\begin{align*}
g:f(X)\to X, \qquad g(y)=\text{the unique }x\in X\text{ such that }f(x)=y
\end{align*}
defines a genuine function.
We must show that $g$ is continuous. The efficient way is to prove that $g$ is itself an isometry. Let $y,y'\in f(X)$. Because $y$ and $y'$ lie in the image of $f$, there exist $x,x'\in X$ such that $y=f(x)$ and $y'=f(x')$. By the definition of $g$, we have $g(y)=x$ and $g(y')=x'$. Hence
\begin{align*}
d_X(g(y),g(y'))=d_X(x,x').
\end{align*}
Since $f$ preserves distances,
\begin{align*}
d_X(x,x')=d_Y(f(x),f(x')).
\end{align*}
Substituting $y=f(x)$ and $y'=f(x')$ gives
\begin{align*}
d_X(g(y),g(y'))=d_Y(y,y').
\end{align*}
Finally, because $d_{f(X)}$ is the restriction of $d_Y$ to $f(X)$, this is the same as
\begin{align*}
d_X(g(y),g(y'))=d_{f(X)}(y,y').
\end{align*}
Thus $g:(f(X),d_{f(X)})\to (X,d_X)$ is an isometry.
[/guided]
[/step]
[step:Conclude that the corestricted map is a homeomorphism]
By the previous step, $g:f(X)\to X$ is an isometry. Applying [citetheorem:8702] to $g$ gives that $g$ is continuous. The map $g$ is the inverse of the bijection $f:X\to f(X)$, while $f$ is continuous by the earlier step. Hence $f:X\to f(X)$ is a bijective continuous map with continuous inverse, so it is a homeomorphism.
[/step]