Show that the function $g:\mathbb{R}^2\rightarrow\mathbb{R}$ given by
$g(x_1,x_2)= \left\{ \begin{array}{lr} 0 & x_1^2+x_2^2<1\\ 1 & \text{otherwise} \end{array} \right.$
is continuous.
I'm not convinced that $g$ is continuous, because when $x_{a}^2+x_{b}^2<1$ and $x_{1}^2+x_{2}^2\geq1$, $d(g(x_a,x_b),g(x_1,x_2))=1$, which should be greater than $\varepsilon$ for some $0<\varepsilon<1$, and the definition of continuity requires it to be less than $\varepsilon$ for all $\varepsilon$.
Apart from the useful proof with sequences in the comments,here it is another topological proof.
Now let $(X,d_1)=(\mathbb{R}^2,d_2)$ where $d_2$ is the Euclideian metric and $(Y,d_2)=(\mathbb{R},|.|)$
and $f(x_1,x_2)= \left\{ \begin{array}{lr} 0 & x_1^2+x_2^2<1\\ 1 & \text{otherwise} \end{array} \right.$
Take the set $\{0\}$ which is a closed subset of $\mathbb{R}$
Then $f^{-1}(\{0\})=B(0,1)$ where $B(0,1)$ is the unit ball which is not a closed subset of $\mathbb{R}^2$
So $f$ is not continuous.