[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]