If $X\approx Y$ and $X$ is contractible then $Y$ is contractible.
Attempt to the solution
Since $X\approx Y$, then there exist a continuous and bijective function $f:X\to Y$ such that $f^{-1}:Y\to X$ is continuous.
Since $X$ is contractible then $id_X\simeq x_o,$ where $x_o$ is a constant function, that is there exist an homotopy $H:I\times I\to X$ such that $H(x,0)=id_X(x)$ and $H(x,1)=x_o(x).$
Now to find $id_Y\simeq y_o$ I did try to draw a diagram
$\require{AMScd}$ \begin{CD} X\times I @>f\times id>> Y\times I\\ @V H V V @VV f\circ H V\\ X @>>f> Y \end{CD}
I am not sure whether if its correct or not.
From here how could I define the homotopy composition $f\circ H,$ $id_Y\simeq y_o$ ?
If someone could help me, thank you.
$f\circ H:Y\times I\to Y$ makes no sense since $H$ is defined on $X\times I$.
Instead notice that $f\times id$ is a homeomorphism so you can let your homotopy be $f\circ H\circ (f\times id)^{-1}$.