I understand that $f:X\rightarrow Y$ is continuous if the pre-image of an open in $Y$ is open in $X$.
Take $f(x)=x²$ as a function $\mathbb{R}\rightarrow \mathbb{R}$.
Then $f^{-1}((-1,1))=[0,1)$ so the square function is not continuous(?).
However if I consider $f$ as a function $\mathbb{R}\rightarrow \mathbb{R^+_0}$ then the conclusion seems different.
Does it mean that continuity depends on the range of the function?