# Continuity of piecewise multivariable function

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$.

• $g$ is indeed not continuous. – Surb Sep 6 '17 at 21:51
• You are right, there must be an error or a typo somewhere – Peter Sep 6 '17 at 21:53
• as you suggested, if $z_n=(0,\tfrac{n-1}{n})$, then $\lim_{n\to\infty}g(z_n)=0\neq 1=g(0,1)$. – Surb Sep 6 '17 at 21:55

Apart from the useful proof with sequences in the comments,here it is another topological proof.

Let $f:(X,d_1) \to (Y,d_2)$ where $(X,d_1), (Y,d_2)$ are metric spaces.

Then $f$ is continuous iff for every closed $V \subseteq Y$ the $f^{-1}(V)$ is a closed subset of $X$.

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.