Prove that function of two variables is continuous I was reading my class examples and I got the function
$$f(x,y)=  
\begin{cases} 
      \frac{1}{2}x^2 + y^2-1& \quad\text{if } x^2+y^2>1,\\
      -\frac{1}{2}x^2 & \quad\text{if } x^2+y^2\leq1.\\
   \end{cases}
$$
Is it continuous over $\mathbb{R}^2$?
Basically the notes explain that making $\lvert f(x,y) - f(x_{0},y_{0}) \lvert$  (if $(x_{0},y_{0})=1$) you end up with $\lvert f(x,y) - (-\frac{1}{2}x_{0}^2) \rvert \leq \lvert \frac{1}{2}x^2 + y^2 - 1 + \frac{1}{2}x_{0}^2\rvert + \lvert -\frac{1}{2}x^2+\frac{1}{2}x_{0}^2 \rvert$.
So, just taking the limit as $(x,y) \rightarrow (x_{0},y_{0})$ (using that $||(x_{0},y_{0})||=1$) you have that the limit is zero.
If $||(x_{0},y_{0})|| \neq 1$ we have that $f$ is continuous because it is the sum of continuous functions and $f$ is continuous over $\mathbb{R}^2$.
I'd like to know how to derive the first part when proving that $f$ is continuous, because I didn't got it 100% clear, please! D:
 A: You need to show that, given any $(x_0,y_0)$ with $x_0^2+y_0^2=1$ and any $\epsilon>0$, there exists some $\delta>0$ so that
$$\left|(x-x_0,y-y_0)\right|\leq\delta\implies |f(x,y)-f(x_0,y_0)|\leq \epsilon.$$
For this, you can use the expression you've written; since $f(x,y)$ is one of $\frac12x^2+y^2-1$ or $-\frac12x^2$, you know
$$\left|f(x,y)-f(x_0,y_0)\right|\in\left\{\left|\frac12x^2+y^2-1+\frac12x_0^2\right|,\left|-\frac12x^2+\frac12x_0^2\right|\right\},$$
so you can definitely get
$$\left|f(x,y)-f(x_0,y_0)\right|\leq\left|\frac12x^2+y^2-1+\frac12x_0^2\right|+\left|-\frac12x^2+\frac12x_0^2\right|.$$
You can then write
$$\frac12x^2+y^2-1+\frac12x_0^2=\frac12x^2+y^2-x_0^2-y_0^2+\frac12x_0^2=\frac{x^2-x_0^2}2+(y^2-y_0^2),$$
so
$$\left|f(x,y)-f(x_0,y_0)\right|\leq |x^2-x_0^2|+|y^2-y_0^2|.$$
Can you use this to finish the bounding?
A: You are wrong on that line. It should read: $|f(x,y) - f(x_0,y_0)|=\left|\frac{x^2}{2}+y^2-1+\frac{x_0^2}{2}\right|= \left|\frac{x^2}{2}+y^2-(x_0^2+y_0^2)+\frac{x_0^2}{2}\right|= \left|\frac{x^2-x_0^2}{2}+y^2-y_0^2\right|\le \frac{1}{2}|x^2-x_0^2|+|y^2-y_0^2|= \frac{1}{2}|x-x_0||x+x_0|+|y-y_0||y+y_0|< \frac{\delta}{2}|x+x_0|+\delta|y+y_0|\le \frac{\delta}{2}(|x-x_0|+|2x_0|)+\delta(|y-y_0|+|2y_0|)< \frac{\delta}{2}(\delta+|2x_0|)+\delta(\delta+|2y_0|)< \frac{\delta}{2}(1+|2x_0|)+\delta(1+|2y_0|)< \epsilon $ if you take $\delta = \text{min}\left(1,\frac{2\epsilon}{3+2|x_0|+4|y_0|}\right)$. Thus $f$ is continuous at $(x_0,y_0)$ on the unit circle, and therefore on $\mathbb{R^2}$ too.
Ah, I found out I missed the part that $f$ could be taking the "other value". But it's a small technical detail that can be added to it. The main thought is still there....
