How to prove equivalence using homeomorphics? The question goes as follows:
Let $(M,d)$ be a metric space, and let $\tau$ be the discrete metric on $M$. Then $(M,d)$ and $(M,\tau)$ are homeomorphic if and only if every subset of $M$ is open in $(M,d)$ if and only if every function $f:(M,d)\to\mathbb{R}$ is continuous. 
I think I got the first equivalence relation right by noticing that every point in $(M,\tau)$ is an open set since $B_\epsilon (x)$ is contained in $x$ for $\epsilon = \frac{1}{2}$. Therefore every subset in $(M,d)$ is open since $(M,d)$ and $(M,\tau)$ are homeomorphic. 
However, I do not see where to start with the other implications. Could somebody give a hint/tip on how to tackle these problems.
Thanks in advance!
 A: Hint:
Recall that a function $f:X\to Y$ between metric spaces (or more generally topological spaces) is continuous iff $f^{-1}(U)$ is open in $X$ for every open subset $U$ of $Y$. Each direction of the second equivalence follows quickly from this characterization of continuity.
Forward direction in spoiler

 Suppose every subset of $M$ is $d$-open. We want to show that every function $f:(M,d)\to\mathbb{R}$ is continuous. Fixing a function $f:(M,d)\to\mathbb{R}$, we know that $f^{-1}(U)$ is $d$-open in $M$ for every subset $U$ of $\mathbb{R}$, so certainly $f^{-1}(U)$ is $d$-open in $M$ for every open subset $U$ of $\mathbb{R}$. Thus $f$ is continuous.

Reverse direction in spoiler:

 Conversely, suppose every function $f:(M,d)\to\mathbb{R}$ is continuous. Due to your previous observation, it suffices to show that each singleton in $M$ is $d$-open. Let $m\in M$. Define $f:(M,d)\to\mathbb{R}$ by $$ f(x) = \begin{cases} f(x)=0 & \text{if $x=m$}\\ f(x)=1 & \text{otherwise}.\end{cases} $$ Then $f$ is continuous by hypothesis, so we have $\{m\}=f^{-1}(-1,1)$ is $d$-open.


While you seem to have the right idea for the first equivalence, your proof appears to only consider the forward direction. You need to also show that if every subset of $M$ is $d$-open, then $(M,d)$ and $(M,\tau)$ are homeomorphic. However this is easy. Define $f:(M,d)\to (M,\tau)$ to be the identity function $f(x)=x$, and then use the above characterization for continuity to conclude that $f$ and its inverse are continuous.
