Continuity of $x^2$ i'm trying to learn the concept of continuity in a more or less formal basis. One definition of continuity (not the most general, but I better learn step by step) is that a function 
$$f:X\subseteq\mathbb{R}\to Y\subseteq\mathbb{R}$$
is continuous at $x_0\in X$ if $$\lim_{x\to x_0}f(x)=f(x_0)$$
This is, $\forall \epsilon>0, \exists \delta>0$ such that $|f(x)-f(x_0)|<\epsilon$ if $x\in X$, $0<|x-x_0|<\delta$
So in order to test if I do understand this, decided to try a particular example, say $f(x)=x^2$, and $f(x_0)=x_0^2$. My first question is:
1) Is an assumption that $f(x_0)=x_0^2$ or do I need to prove it? I think I don't have to prove it because that equality follows from the definition of $f(x)$ but there may be any kind of subtlety that I don't see.
Assuming I can say $f(x_0)=x_0^2$ then the task is to show that there exists such a number $\delta$:
I'm given $\epsilon>0$ such that $|f(x)-f(x_0)|<\epsilon$ this is $|x^2-x_0^2|<\epsilon$, Rewriting $|x^2-x_0^2|=|x-x_0||x+x_0|<\epsilon$ 
2) Can I set 
$$\delta<\frac{\epsilon}{|x+x_0|}?$$
what if $x=-x_0$?
Thanks for your time.
 A: There is a fundamental misunderstanding here what the hypothesis is and what you have to prove. The square function is continuous in $x_0$ means (in words): for every positive $\varepsilon$ there exists a positive number $\delta$ such that for every number $x$ with the property $|x-x_0|<\delta$, the inequality $|x^2-x_0^2|<\varepsilon$ holds.
So you are not given an $\varepsilon$ with $|x^2-x_0^2|<\varepsilon$, rather, that is what you ultimately have to prove.
Maybe the square function is not the easiest example to start with; maybe it helps to try a linear function first ($f(x)=ax+b$).
A: 1) $f(x_0)$ is given, in this case $f(x_0)=x_0^2$. To show continuity of $f$, we have to show
$$
\lim_{x\to x_0}f(x)=f(x_0)
$$
2) $\delta$ determines which $x$ are in $|x-x_0|\le\delta$. It is not proper to have $\delta$ depend on $x$; it should only depend on $x_0$ and $\epsilon$.
For example, if $\delta<\min\left(\dfrac{\epsilon}{3x_0}\,,\,\dfrac{x_0}{2}\right)$, then since $x+x_0=2x_0+(x-x_0)$, we have
$$
\begin{align}
\left|\,x^2-x_0^2\,\right|
&=\left|\,x-x_0\,\right|\left|\,x+x_0\,\right|\\
&\le\dfrac{\epsilon}{3x_0}\frac{5x_0}{2}\\
&=\frac{5\epsilon}{6}\\
&\le\epsilon
\end{align}
$$
A: *

*You have defined $f(x)$ so that $f(x_0)=x_0^2$, so this is granted. But you could have defined $f$ differently...

