[proofplan]
We prove both implications directly from the metric definitions. To show that completeness of $X$ implies completeness of $Y$, we lift an arbitrary [Cauchy sequence](/page/Cauchy%20Sequence) in $Y$ to a sequence in $X$ using surjectivity, use distance preservation to show the lifted sequence is Cauchy, and then push its limit forward through $f$. The reverse implication is similar: map a Cauchy sequence in $X$ into $Y$, use completeness of $Y$, choose a preimage of the limit by surjectivity, and use distance preservation to recover convergence in $X$.
[/proofplan]
[step:Lift Cauchy sequences from $Y$ to $X$ to prove completeness of $Y$]
Assume that $(X,d_X)$ is complete. Let $(y_n)_{n\in\mathbb N}:\mathbb N\to Y$ be a Cauchy sequence in $(Y,d_Y)$. Since $f$ is surjective, for each $n\in\mathbb N$ choose $x_n\in X$ such that $f(x_n)=y_n$. This defines a sequence $(x_n)_{n\in\mathbb N}:\mathbb N\to X$.
We prove that $(x_n)_{n\in\mathbb N}$ is Cauchy in $(X,d_X)$. Let $\varepsilon>0$. Since $(y_n)_{n\in\mathbb N}$ is Cauchy in $(Y,d_Y)$, there exists $N\in\mathbb N$ such that for all $m,n\ge N$,
\begin{align*}
d_Y(y_m,y_n)<\varepsilon.
\end{align*}
For all $m,n\ge N$, distance preservation gives
\begin{align*}
d_X(x_m,x_n)=d_Y(f(x_m),f(x_n))=d_Y(y_m,y_n)<\varepsilon.
\end{align*}
Thus $(x_n)_{n\in\mathbb N}$ is Cauchy in $(X,d_X)$.
By completeness of $(X,d_X)$, there exists $x\in X$ such that $x_n\to x$ in $(X,d_X)$. We claim that $y_n\to f(x)$ in $(Y,d_Y)$. Let $\varepsilon>0$. Since $x_n\to x$, there exists $N\in\mathbb N$ such that for all $n\ge N$,
\begin{align*}
d_X(x_n,x)<\varepsilon.
\end{align*}
For all $n\ge N$, distance preservation gives
\begin{align*}
d_Y(y_n,f(x))=d_Y(f(x_n),f(x))=d_X(x_n,x)<\varepsilon.
\end{align*}
Therefore every Cauchy sequence in $(Y,d_Y)$ converges in $Y$, so $(Y,d_Y)$ is complete.
[guided]
Assume that $(X,d_X)$ is complete. To prove that $(Y,d_Y)$ is complete, we must start with an arbitrary Cauchy sequence in $Y$ and prove that it converges to a point of $Y$.
Let $(y_n)_{n\in\mathbb N}:\mathbb N\to Y$ be a Cauchy sequence in $(Y,d_Y)$. The only way to use completeness of $X$ is to produce a Cauchy sequence in $X$. Surjectivity gives exactly this: since $f(X)=Y$, for each $n\in\mathbb N$ there exists $x_n\in X$ such that
\begin{align*}
f(x_n)=y_n.
\end{align*}
Thus we have a sequence $(x_n)_{n\in\mathbb N}:\mathbb N\to X$ lifting the original sequence.
We now verify that this lifted sequence is Cauchy. Let $\varepsilon>0$. Since $(y_n)_{n\in\mathbb N}$ is Cauchy in $(Y,d_Y)$, there exists $N\in\mathbb N$ such that for all $m,n\ge N$,
\begin{align*}
d_Y(y_m,y_n)<\varepsilon.
\end{align*}
For such $m,n$, the isometry identity applied to $x_m,x_n\in X$ gives
\begin{align*}
d_X(x_m,x_n)=d_Y(f(x_m),f(x_n)).
\end{align*}
Because $f(x_m)=y_m$ and $f(x_n)=y_n$, this becomes
\begin{align*}
d_X(x_m,x_n)=d_Y(y_m,y_n)<\varepsilon.
\end{align*}
Hence $(x_n)_{n\in\mathbb N}$ is Cauchy in $(X,d_X)$.
Completeness of $(X,d_X)$ now applies: there exists $x\in X$ such that $x_n\to x$ in $(X,d_X)$. We must show that the original sequence $(y_n)_{n\in\mathbb N}$ converges in $Y$, and the natural candidate for its limit is $f(x)$. Let $\varepsilon>0$. Since $x_n\to x$, there exists $N\in\mathbb N$ such that for all $n\ge N$,
\begin{align*}
d_X(x_n,x)<\varepsilon.
\end{align*}
Using distance preservation again, and using $y_n=f(x_n)$, we obtain for all $n\ge N$,
\begin{align*}
d_Y(y_n,f(x))=d_Y(f(x_n),f(x))=d_X(x_n,x)<\varepsilon.
\end{align*}
Thus $y_n\to f(x)$ in $(Y,d_Y)$. Since the Cauchy sequence $(y_n)_{n\in\mathbb N}$ was arbitrary, every Cauchy sequence in $Y$ converges in $Y$, so $(Y,d_Y)$ is complete.
[/guided]
[/step]
[step:Push Cauchy sequences from $X$ to $Y$ to prove completeness of $X$]
Assume that $(Y,d_Y)$ is complete. Let $(x_n)_{n\in\mathbb N}:\mathbb N\to X$ be a Cauchy sequence in $(X,d_X)$. Define a sequence $(z_n)_{n\in\mathbb N}:\mathbb N\to Y$ by $z_n=f(x_n)$ for each $n\in\mathbb N$.
We prove that $(z_n)_{n\in\mathbb N}$ is Cauchy in $(Y,d_Y)$. Let $\varepsilon>0$. Since $(x_n)_{n\in\mathbb N}$ is Cauchy in $(X,d_X)$, there exists $N\in\mathbb N$ such that for all $m,n\ge N$,
\begin{align*}
d_X(x_m,x_n)<\varepsilon.
\end{align*}
For all $m,n\ge N$, distance preservation gives
\begin{align*}
d_Y(z_m,z_n)=d_Y(f(x_m),f(x_n))=d_X(x_m,x_n)<\varepsilon.
\end{align*}
Thus $(z_n)_{n\in\mathbb N}$ is Cauchy in $(Y,d_Y)$.
By completeness of $(Y,d_Y)$, there exists $y\in Y$ such that $z_n\to y$ in $(Y,d_Y)$. Since $f$ is surjective, choose $x\in X$ such that $f(x)=y$. We show that $x_n\to x$ in $(X,d_X)$. Let $\varepsilon>0$. Since $z_n\to y$, there exists $N\in\mathbb N$ such that for all $n\ge N$,
\begin{align*}
d_Y(z_n,y)<\varepsilon.
\end{align*}
For all $n\ge N$, using $z_n=f(x_n)$ and $y=f(x)$, distance preservation gives
\begin{align*}
d_X(x_n,x)=d_Y(f(x_n),f(x))=d_Y(z_n,y)<\varepsilon.
\end{align*}
Hence $(x_n)_{n\in\mathbb N}$ converges in $X$. Therefore every Cauchy sequence in $(X,d_X)$ converges in $X$, so $(X,d_X)$ is complete.
[/step]
[step:Combine the two implications]
The first step proves that completeness of $(X,d_X)$ implies completeness of $(Y,d_Y)$. The second step proves that completeness of $(Y,d_Y)$ implies completeness of $(X,d_X)$. Therefore $(X,d_X)$ is complete if and only if $(Y,d_Y)$ is complete.
[/step]