Proving Continuity of $f(x)=x^2$ I'm trying to prove the continuity of $f(x)=x^2$ using my book's definition of continuity and the distance function $d(x,a)=|x-a|$.
In order to prove that, I must prove that given $\epsilon \gt 0$, there exists $\delta$ defined in terms of $\epsilon$ such that
$$|x-a|\lt\delta$$
implies
$$|x^2-a^2|\lt\epsilon$$
I got so far as to "unsimplify" the second inequality to get
$$|x+a||x-a|\lt \epsilon$$
But I can't figure out how to define $\delta$ in order to complete the proof. I can't use $\delta=\sqrt\epsilon$, because $a$ could be arbitrarily large, meaning that $|x+a|$ could be much larger than $|x-a|$. And I'm not allowed to define $\delta$ in terms of $x$ or $a$, either.
Any ideas?
 A: Just force a bound on $\delta$. If $\delta < 1$, then $|x|-|a| \leq |x-a| < 1$ implies $|x|<1+|a|$. So $$|x^2-a^2| = |x+a||x-a| < (|x|+|a|)\delta \color{red}{<} (2|a|+1)\delta$$tells us that $\delta \doteq \min\{ 1, \epsilon/(2|a|+1) \}$ fits the bill. My answer here might be useful too.
A: As a first step, take $\Delta=1$. Then$$|x-a|<\Delta\iff|x-a|<1\Longrightarrow|x+a|=|x-a+2a|\leqslant1+2|a|.$$Now, take $\delta=\min\left\{1,\frac\epsilon{1+2|a|}\right\}$. Then$$|x-a|<\delta\Longrightarrow|x^2-a^2|=|x+a|.|x-a|<(1+2|a|)\frac\epsilon{1+2|a|}=\epsilon.$$
A: From Stephen Abbott's Understanding Analysis,

Let's show
  $$ \lim_{x \to 2} g(x) = 4 $$
  where $g(x) = x^2$. ... a little algebra reveals
  $$ |g(x) -4| = |x^2 -4| = |x+2||x-2|. $$
  ...we need an upper bound on $|x+2|$ in order to know how small to choose $\delta$. If we agree that our $\delta$-neighborhood around $c = 2$ must have radius no bigger than $\delta = 1$, then we get the upper bound $|x+2| \leq |3 + 2| = 5$ for all [$x \in (c - \delta, c+\delta)$].
Now choose $\delta = \min\left( 1, \epsilon/5 \right)$.

This choice baffled me at first, but the idea is to choose a way to bound $|x + 2|$ so that it won't get too large. The proof finishes with that $|x-2| < \delta$, we obtain $|x^2 - 4| < \epsilon$.
You can use a similar idea by saying, perhaps, that $|x + a| \leq |2a + 1|$ and choosing $\delta = \min \left(1, \frac{\epsilon}{|2a+1|} \right)$. There may be some tweaks needed here.
(I'm aware that the above passage asks for a limit, but it applies to continuity as well.)
A: f(x) = x2 is only a uniformly continuous function if it is restricted to a bounded interval- by which I mean, it is impossible to find δ in terms of ϵ such that for all x, d(x, a) < δ implies d(x2, a2) < ϵ. This is because the slope of the x2 function increases boundlessly as x tends towards plus or minus infinity. If you fix ϵ and δ dependent on ϵ, for large (or small) enough x, the rate of change of x2 will be high enough that the implication d(x, a) < δ ==> d(x2, a2) < ϵ does not hold.
It is possible to do this if your domain is bounded, however. Say we are examining the function on the closed interval [c,d] (if your domain is bounded but not a closed interval, take some closed interval [c,d] that contains your domain). Let ϵ > 0. The absolute value of the derivative |f'(x)| = 2|x| is continuous on [c,d] and thus attains its maximum at some point x' in [c,d]. Take δ < min{1,ϵ/(1+2|x'|)}. As noted by previous answers, this δ works at x'. Moreover, because 2|x'| > 2|a| for all other a in the interval [c,d] (by our choice of x'), we have that δ < min{1,ϵ/(1+2|x'|)} < min{1,ϵ/(1+2|a|)} for all a in [c,d]. Thus the choice of δ works everywhere on our domain, and is dependent only on ϵ and a constant x'.
