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.