Just let $\rho(y_1,y_2)=d\big(f^{-1}(y_1),f^{-1}(y_2)\big)$ and check (1) that $\rho$ is a metric on $Y$, and (2) that it generates the right topology.
Note that this should be the obvious thing to try. The fact that $X$ and $Y$ are homeomorphic means that from a topological point of view $Y$ is just $X$ under a different name, and the homeomorphism $f$ is the ‘translator’ from $X$ to $Y$. Thus, $f(x)$ should behave in $Y$ exactly as $x$ does in $X$, and if we can fit a certain distance $d(x_1,x_2)$ to two points of $X$ in a way that fits the topology of $X$, we ought to be able to fit the same distance between the points $f(x_1)$ and $f(x_2)$ in a way that fits the topology of $Y$.