Let $\displaystyle f: (M_1,d_1)\to(M_2,d_2)$ and $\displaystyle G(f)=\{(x,f(x))|x\in M_1\}\subseteq M_1\times M_2$ and let $\displaystyle \tilde f: (M_1,d_1)\to(G(f),d_p).$ Consider $\displaystyle \tilde f(x)=(x,f(x))$ and $\displaystyle d_p((x_1,x_2),(y_1,y_2))=\sqrt{d_1(x_1,y_1)^2+d_2( x_2,y_2)^2}$ for all $\displaystyle (x_1,y_1),(x_2,y_2)\in M_1\times M_2.$ Prove that $\displaystyle \tilde f$ is a homeomorphism.

In order to be a homeomorphism we need bijectivity for $\displaystyle \tilde f$ and continuity for $\displaystyle \tilde f$ and $\displaystyle \tilde f^{-1},$ is there a faster way to solve this?