Critique my proof of $f(x) = x^2, x \in \mathbb{R}$ being continuous Let $\epsilon > 0$ and $a \in \mathbb{R}$. Let $\delta > 0$ s.t $\delta < \frac{\epsilon}{\vert x + a \vert}$ and $\lvert x - a \rvert < \delta$. Thus, 
$$\lvert f(x) - f(a) \rvert = \lvert x^2 - a^2 \rvert = \lvert x + a \rvert \lvert x - a \rvert < \delta \lvert x + a \rvert$$$$ < \frac{\epsilon}{\lvert x + a\rvert} \lvert x + a \rvert = \epsilon.$$Hence, $\lvert x - a \rvert < \delta \Rightarrow \lvert f(x) - f(a) \rvert < \epsilon$. Because $a$ was arbitrary, we conclude that $f(x) = x^2, x \in \mathbb{R}$ is continuous. 
 A: The error lies in the sentence

Let $\delta > 0$ s.t $\delta < \frac{\epsilon}{\vert x + a \vert}$ and $\lvert x - a \rvert < \delta$.

As I commented, the choice of $\delta$ cannot depend on $x$ because there is no variable $x$ in scope at this point.

Let's review the strategy for crafting an $\epsilon$-$\delta$ continuity proof.  Given the function
$$
f(x) = x^2, \quad x \in \mathbb{R},
$$
our goal is to show that

$f$ is continuous,

which is by definition equivalent to

for any $a \in \mathbb{R}$, $f$ is continuous at $a$.

Fix $a \in \mathbb{R}$.  By the definition of continuity, we need to show that

for any $\epsilon > 0$, there exists a number $\delta > 0$ such that, for any $x$,
$$
\lvert x - a \rvert < \delta \quad \implies \quad
\lvert x^2 - a^2 \rvert < \epsilon.
$$

Fix $\epsilon > 0$.  To show that there exists a number $\delta > 0$ such that the aforementioned condition holds, we pick a value for $\delta$ based on quantities that are in scope (namely $a$ and $\epsilon$) and show that the desired condition holds for that value of $\delta$.
To do so, we observe that the desired relation $\lvert x^2 - a^2 \rvert < \epsilon$ is equivalent to $\lvert x - a \rvert \lvert x + a \rvert < \epsilon$, so we would like to bound both factors $\lvert x - a \rvert$ and $\lvert x + a \rvert$ from above.  Automatically, the first factor $\lvert x - a \rvert$ is bound by whatever value of $\delta$ we choose.  There is some freedom in how we choose to bound the second factor $\lvert x + a \rvert$; one possibility is to take advantage of the triangle inequality to get
$$
\lvert x + a \rvert
= \lvert (x - a) + 2a \rvert
\le \lvert x - a \rvert + \lvert 2a \rvert
< \delta + 2 \lvert a \rvert.
$$
If we choose $\delta$ such that, for example,
$$
\delta \le 1, \tag{1} \label{1}
$$
then $$
\lvert x + a \rvert < 1 + 2 \lvert a \rvert,
$$
so that in order to guarantee $\lvert x - a \rvert \lvert x + a \rvert < \epsilon$, it suffices to make
$$
\lvert x - a \rvert < \frac{\epsilon}{1 + 2 \lvert a \rvert}.
\tag{2} \label{2}
$$
Therefore, we decide to pick
$$
\delta = \min \Bigl\{ 1, \frac{\epsilon}{1 + 2 \lvert a \rvert} \Bigr\}
$$
in order to guarantee both \eqref{1} and \eqref{2}.

This is, of course, not the only possible choice of $\delta$.
For example, Thomas Andrews's answer mentions an alternative choice
$$
\delta = \sqrt{\epsilon + a^2} - \lvert a \rvert.
$$
A: It pays well, to think of the definition of continuity in terms of neighbourhoods.
Definition. Let $f:A \to \mathbf{R}$ be any real-valued function. The function $f(x)$ is said to be continuous at $c \in A$, if for all $\epsilon > 0$, there exists $\delta > 0$, such that for all $x \in A$, satisfying $|x - c| < \delta$, the distance $|f(x) - f(c)| < \epsilon$.
Mathematically, $f(x)$ is continuous at $c$, iff
$$(\forall \epsilon > 0)(\exists \delta)(\forall x \in A)(\forall |x-c|<\delta)(|f(x) - f(c)|<\epsilon)$$
Equivalently,
Definition. The function $f(x)$ is said to be continuous at $c \in A$, if no matter what $\epsilon$-neighborhood of $f(c)$ you choose, there exists a corresponding $\delta$-neighboorhood around $c$, such that if ($x$ is in the domain $A$ and) $x$ lies in $V_\delta(c)$, you find that $f(x)$ lies in $V_\epsilon(f(c))$.
Mathematically, $f(x)$ is said to be continuous at $c$ iff
$$(\forall V_\epsilon(f(c))(\exists V_\delta(c))(\forall x \in A)(\forall x\in V_\delta(c))(f(x)\in V_\epsilon(f(c)))$$
You could have a different $\delta$-response to each $\epsilon-$ challenge and the point $c$. But, this $\delta$-response holds for all $x$ falling in $V_\delta(c)$.
A: You are correct to assume we want a useful bound on $|x+a|$ when $|x-a|<\delta.$
But you cannot choose $\delta$ in terms of $x.$
But you can use: $|x+a|\leq |x-a|+2|a|.$
Then: $$|x^2-a^2|\leq |x-a|^2+2|a||x-a|.$$
So you want: $$\delta^2+2|a|\delta\leq \epsilon.$$
Or: $$(\delta+|a|)^2\leq \epsilon+a^2$$ or $$\delta\leq \sqrt{\epsilon +a^2}-|a|$$
You have to prove the right side is positive, but that isn't hard.
A: It is always good practice to clearly state upfront all that you know from a problem:
$f:\mathbb R\to\mathbb R,\quad x\mapsto x^2$
Let $\:(x,a)\in\mathbb R\times\mathbb R\:$.
From the definition of a continuous function,
$$\forall x\:\:\forall \varepsilon > 0\:\: \exists \delta_{x,\varepsilon} > 0\:\text{ s.t. } |x - a| < \delta_{x,\varepsilon}\Rightarrow |f(x) - f(a)| < \varepsilon$$
So from the definition the idea is that $\:\delta\:$ could depend on both $\:x\:$ and $\:\varepsilon$.
Compare this to the uniform continuity definition:
$$\:\:\forall \varepsilon > 0\:\: \exists \delta_{\varepsilon} > 0\:\text{ s.t. }\:\forall x,y\:\:\: |x - y| < \delta_{\varepsilon}\Rightarrow |f(x) - f(a)| < \varepsilon$$
