Prove that $f$ is a homeomorphism Let $f: (M,d) \rightarrow (N,\rho)$ be a one-one and onto mapping. Prove that the following are equivalent: 


*

*$f$ is a homeomorphism. 

*$g: N\rightarrow \mathbb{R}$ is contiuous if and only if $gof: M
   \rightarrow \mathbb{R}$ is continuous.
To show $1 \implies 2$ I have proceeded in the following manner. 
$f$ is a homeomorphism $\implies$ $f$ is continuous from $M \rightarrow  N$ $\implies$ For any sequence $(x_{n})$ in $M$ converging to $x$ we have $f(x_{n}) \rightarrow f(x)$. Let, $g$ is continuous from $N  \rightarrow \mathbb{R}$ Therefore, $g(f(x_{n}) \rightarrow g(f(x))$. Hence, $gof(x)$ is continuous in $M$. 
Since, the statement 2 had an iff next, I assumed that $f$ is a homemomrphism and $gof$ is continuous and proved that $g$ is continuous. 
Now, I am not sure how I have to show $2 \implies 1$
Source:Real Analysis by N.L Carothers Page 72, Problem 54

A hint for $\ 2\implies 1\ $ is to take $\ g(y) = \rho\left(y,f(x_0)\right)\ $ for any fixed $\ x_0\in M\ $, and show that the continuity of $\ g\circ f\ $ implies the continuity of $\ f\ $ at $\ x_0\ $.
Edit: I originally missed the OP's statement that the proof of the continuity of $\ g\ $ following from $1$ and the continuity of $\ g\circ f\ $ had already been done.  So 
I was incorrect in my earlier statement that this was still needed to complete the proof of $\ 1\implies 2\ $.
