If $f: \Bbb R \rightarrow \Bbb R$ is continuous at $a$ then $f^2$ is continuous at $a$. (use the definition of continuity)
My idea: I know that if f is continuous at a then:
$$ \forall \epsilon > 0, \exists \delta>0 : |x-a|< \delta \Longrightarrow |f(x)-f(a)|< \epsilon $$
I want to have for a $\delta_1$ then it satisfies that $|f^2(x)-f^2(a)|< \epsilon$, my try:
I know that
$$ -\epsilon <f(x)-f(a)< \epsilon $$ $$ -\epsilon \cdot (f(x)+f(a)) <(f(x)-f(a)) \cdot (f(x)+f(a))< \epsilon \cdot (f(x)+f(a)) $$ $$ -\epsilon \cdot (f(x)+f(a)) <f^2(x)-f^2(a)< \epsilon \cdot (f(x)+f(a)) $$
From here I can't advance anymore, I don't know if my approach was right.
Can you help me with this?
Note: $f^2= f \cdot f$
If you really want to use a $\varepsilon-\delta$ approach, you can start by taking $\delta_0>0$ such that$$|x-a|<\delta_1\implies|f(x)-f(a)|<1,$$and then$$|x-a|<\delta_1\implies|f(x)|\leqslant|f(x)-f(a)|+|f(a)|<1+|f(a)|,$$and therefore$$|x-a|<\delta_1\implies|f(x)+f(a)|\leqslant1+2|f(a)|.$$Now, given $\varepsilon>0$, take $\delta_2>0$ such that$$|x-a|<\delta_2\implies|f(x)-f(a)|<\frac\varepsilon{1+2|f(a)|},$$and then$$|x-a|<\min\{\delta_1,\delta_2\}\implies\left|f^2(x)-f^2(a)\right|=\left|f(x)+f(a)\right|\left|f(x)-f(a)\right|<\varepsilon.$$Of course, it's much to solve the problem using that fact that if two functions are continuous at a point, then so is their product. Or the fact that if a function $f$ is continuous at a point $a$ and if a function $g$ is continuous at $f(a)$, then $g\circ f$ is continuous at $a$.