Show Continuity Using Epsilon Delta Definition [closed]

Proving your first question is equivalent to showing that for all $x$ $$\lim_{x \to a}x^2=a^2.$$ To do this with the $\varepsilon-\delta$ definition we need find a $\delta$ such that $|x^2 - a^2| < \varepsilon$ whenever $|x-a| < \delta$. We can manipulate this first inequality to obtain $$|x^2-a^2|=|x-a|\cdot|x+a| < \varepsilon.$$ And then, because we are free to impose whatever requirements we like on $|x-a|$ (we just need to find a $\delta$ that works, whatever it may be), we can require that $|x-a| < 1$. The $1$ is just chosen for convenience, any number would work. So now that we have $|x-a| < 1$, we know from the triangle inequality that $|x| - |a| \leq |x - a| < 1$, or $|x| < 1 + |a|$. This means that $|x+a| \leq |x| + |a| < 2|a| + 1$. Putting this together with our earlier inequality that $|x-a|\cdot|x+a| < \varepsilon$, we can say that $$|x^2-a^2| = |x-a| \cdot |x+a| < |x-a| \cdot(2|a|+1).$$

So to summarize, if we require that $|x-a| < 1$ and $|x-a| < \frac{\varepsilon}{2|a|+1}$, this implies that $|x^2 - a^2| < \varepsilon$. Another way of rewriting our requirements for $|x-a|$ is $|x-a| < \mathrm{min}(1,\frac{\varepsilon}{2|a|+1})$, or $\delta = \mathrm{min}(1,\frac{\varepsilon}{2|a|+1})$.


Now to prove (b), first note that our proof above implies that $f(x) = x^2$ is continuous for all $x > 0$, and therefore $g(x)$ is continuous for $x > 0$. To prove that it is continuous for all $x < 0$ we just need to prove that $$\lim_{x\to a}2x=2a.$$ This can be done by choosing $\delta = \varepsilon / 2$, because then if $|x-a| < \delta = \varepsilon/2$, this implies that $2|x-a| < \epsilon$, or $|2x - 2a| < \varepsilon$.

Now all that's left is to prove that the function is continuous at $x = 0$. To do this, you need to show that $$\lim_{x \to 0^+}x^2 = \lim_{x \to 0^-} 2x = g(0) = 0.$$

But we've already proven this! Since our proofs from above imply that $\lim_{x \to 0} x^2 = 0$, and this limit only exists if it is equal to both the left and right limits, $\lim_{x \to 0^+} x^2 = 0$. The same argument holds for $\lim_{x \to 0^-} 2x$, and this completes the proof.