Possible mistake in this proof from textbook The textbook gives this proof to show the continuity of $f(x)=x^2$ using the epsilon delta definition. 
$$|f(x)-f(x_0)| = |x^2-x^2_0|= |x-x_0| \cdot |x+x_0|$$
Now they know from the definition $ |x-x_0| < \delta $
$$|x-x_0| \cdot |x+x_0| < \delta \cdot |x+x_0|$$
Because they want to eliminiate the $x$, since delta is not allowed to depend on x, they estimate that 
w.l.o.g $$ \frac{x_0}{2} < |x| < \frac{3x_0}{2} $$ 
substitute $\frac{3x_0}{2}$ for $x$ and finish the proof from there.
The estimate is not valid, since $x^2$ is defined for $x=0$ and therefore the equality does not always hold. They even said a couple paragraphs ago, that this kind of estimate does not work if the function is defined for $x=0$.
Is the textbook wrong or what am I not seeing?
 A: I have to admit that I don't see where your book is going. 
Since making $\delta $ smaller will not hurt you, you can prescribe $\delta \leq1$. Then  $|x|<|x_0|+1$, and so $|x+x_0|<2|x_0|+1$. If you now choose  $$\delta=\min\left\{1,\frac\varepsilon {2|x_0|+1}\right\}, $$ you get $|x^2-x_0^2|<\varepsilon $ whenever $|x-x_0|<\delta $.
A: In fact, the author has taken $\delta = \min\left\lbrace\dfrac{\lvert x_0\rvert}{2},\dfrac{2}{5\lvert x_0\rvert}\varepsilon\right\rbrace$, giving us
\begin{align}
\left\lvert\lvert x\rvert-\lvert x_0\rvert\right\rvert \le \lvert x-x_0 \rvert <& \frac{\lvert x_0 \rvert}{2} \\
-\frac{\lvert x_0 \rvert}{2} < \lvert x\rvert-\lvert x_0\rvert <& \frac{\lvert x_0 \rvert}{2} \\
\frac{\lvert x_0 \rvert}{2} < \lvert x\rvert <& \frac{3\lvert x_0 \rvert}{2},
\end{align}
which is the range of $x$ in the question.  This estimate is not valid when $x_0 = 0$ since $\delta = 0$, but in the $\delta-\epsilon$ definition for limits/continuity, we require $\delta >0$.  That's why the estimate $$\bbox[5px,border:solid red 1px]{\delta=\min\left\{1,\frac\varepsilon {2|x_0|+1}\right\}}$$ in another answer is better due to the absence of $x_0$ in the numerator, so the choice of $\delta$ is not affected even if $x_0 = 0$.
If $x_0 \ne 0$, we have $\lvert x\rvert > \dfrac{\lvert x_0 \rvert}{2} > 0$.  If $x_0 = 0$, we can't do the same to conclude $\lvert x\rvert > 0$.


*

*We have $\lvert f(x)-f(x_0)\rvert = |x-x_0| \cdot |x+x_0| < \delta \cdot |x+x_0|$, and

*we want $\lvert f(x)-f(x_0)\rvert < \varepsilon$, so it suffices to set an upper bound for $\lvert x + x_0 \rvert$.


$$\lvert x + x_0 \rvert \le \lvert x \rvert + \lvert x_0 \rvert \le \frac{3\lvert x_0 \rvert}{2} + \lvert x_0 \rvert < \frac{5\lvert x_0 \rvert}{2},$$
Thus we have
$$\lvert f(x)-f(x_0)\rvert < \delta \cdot |x+x_0| < \delta \cdot \frac{5\lvert x_0 \rvert}{2} \le \varepsilon,$$
ending the proof for $x_0 \ne 0$.
Another problem in the above proof is obvious: when $x_0 = 0$, we can't define $\delta$ as above since $\dfrac{2}{5\lvert x_0\rvert}\varepsilon$ is undefined.  That's why we usually add a $1$ to the denominator in textbooks: $\delta = \min\left\lbrace\dfrac{\lvert x_0\rvert}{2},\dfrac{2}{5\lvert x_0\rvert + 1}\varepsilon\right\rbrace$.
$$\lvert f(x)-f(x_0)\rvert < \delta \cdot |x+x_0| < \delta \cdot \frac{5\lvert x_0 \rvert}{2} \le \frac{2}{5\lvert x_0\rvert + 1} \varepsilon \cdot \frac{5\lvert x_0 \rvert}{2} < \varepsilon$$
