# Prove that a function is continuous using basic open sets

Using basic open sets of $\Bbb R$, prove that $f(x,y,z)=x^2+y^2+z^2+2x+2y+6$ is a continuous function from $\Bbb R^3$ to $\Bbb R$.

My attempt:

Since $f(x,y,z)$ is continuous and $f(x,y,z)\in \mathcal B$ , where $\mathcal B$ is the basis of $\Bbb R$, (I.e. the collection of all open intervals $(a,b)$), then the pre-image $f^{-1}(\mathcal B)=f^{-1}((a,b))$ is open.

So $f^{-1}((a,b))=\{(x,y,z): a< x^2+y^2+z^2+2x+2y+6 <b \}$

And this is where I'm stuck. Am I even going down the right direction? What's the next step? Any help would be great, thanks.

$$x^2+y^2+z^2+2x+2y+6=(x+1)^2+(y+1)^2+z^2+4$$
That is, $f(\mathbf x)=4+d(\mathbf x, P)^2$ where $P$ is the point $(-1,-1,0)$.