Prove that $f$ is continuous at every irrational number, but discontinuous at every rational number.
Now, let $d$ and $d'$ be strongly equivalent metrics on $M$.
Here are some further problems to think about out of interest. You do not need to attempt them, nor should you submit them with the assignment.
Let $M$ be a metric space, and define a metric on $M\times M$ by \begin{align*} d_2 : (M \times M) \times (M \times M) &\longrightarrow \R_{\geq0}\\ ((x_1, y_1), (x_2, y_2)) &\longmapsto \sqrt{d_M(x_1, x_2)^2 + d_M(y_1, y_2)^2}. \end{align*} (You may take for granted that this is a metric; notice that if $M = \R$, $d_2$ is the usual distance on $\R^2$.)
Prove that the original metric on $M$, $d_M : M \times M \to \R_{\geq0}$, is continuous on the metric space $(M\times M, d_2)$.