# Continuity of $x^2$ over $\mathbb{R}$

Suppose $$f: \mathbb{R} \rightarrow \mathbb{R}$$ is defined by $$f(x) = x^2$$. I have a rather elementary question, but can one say that this function is continuous on the whole real line?

If we restrict the codomain to $$\mathbb{R}_{\geq 0}$$ then continuity is clear using both the $$\epsilon$$-$$\delta$$ definition or the topological one. However for negative image points this may be a problem. I believe we may circumvent this by saying $$f^{-1}((-\infty, 0)) = \emptyset$$, which is open by definition, and hence the map is overall continuous. However it seems silly to say a function is continuous at points/sets where it cannot be defined. Moreover, trick will not work using the $$\epsilon$$-$$\delta$$ definition and so it appears to be incorrect.

• @ThomasAndrews Yes that was a typo, my apologies. Commented Aug 31, 2022 at 18:26
• “However it seems silly to say a function is continuous at points/sets where it cannot be defined” – but $f(x) = x^2$ is defined everywhere. Commented Aug 31, 2022 at 18:28
• “Moreover, trick will not work using the $\epsilon$-$\delta$ definition and so it appears to be incorrect.” – unclear to me as well. The $\epsilon$-$\delta$ definition for continuity works without problems, at any $x \in \Bbb R$. Commented Aug 31, 2022 at 18:29
• First of all, "continuous on the whole real line" is about the domain, while $(-\infty,0)$ is an open subset of the range. Commented Aug 31, 2022 at 18:32

First, it's not a trick per se to write $$f^{-1}((-\infty,0)) = \emptyset$$, there are no values $$x \in \mathbb{R}$$ such that $$f(x) = x^2 \in (-\infty,0)$$, so the preimage is empty. You are correct then in saying that using the topological definition of continuity the function $$f$$ is continuous on $$\mathbb{R}$$ with the standard topology.
The function is also continuous using the the $$\epsilon-\delta$$ definition. Remember that the $$\epsilon-\delta$$ definition of continuity says that for any $$x_0 \in Dom(f)$$ and any $$\epsilon > 0$$, there exists a $$\delta > 0$$ such that if $$|x-x_0| < \delta$$ then $$|f(x)-f(x_0)|<\epsilon$$. Since there are no $$x_0 \in \mathbb{R}$$ such that $$f(x_0) < 0$$, there is no problem with negative values in the codomain.
• Ah I see now, I believe it was a silly mistake on my end to not write out the $\epsilon$-$delta$ definition for this problem. Thanks! Commented Aug 31, 2022 at 18:33
We say a function is continuous at points in its domain, not its codomain. In noting that $$f^{-1}((-\infty, 0)) = \emptyset$$, you have show that $$f$$ is continuous on $$\emptyset$$ which is, since $$\emptyset$$ is open, vacuously true.
Re the general definition, that $$f$$ is continuous iff ( def.) the inverse image of an open set is open, consider any open $$(a,b)$$ set in the "Target" $$\mathbb R_+$$ (i.e., so that $$0\leq a< b$$). Its inverse image under $$f$$ is $$( \sqrt a, \sqrt b) \cup (-\sqrt a, -\sqrt b)$$, which is the union of two ope sets, ad is therefore open in $$\mathbb R$$