Is this set open or closed (or both?)

It is not open because it contains $(1,1,0)$ and every neighborhood if this point contains points with $z \neq 0$. It is not closed because $(\frac 1 n, \frac 1 n,0)$ is a sequence in this set which converges to a point outside the set.


No, it is not an open set. For instance, $(1,1,0)\in D$, but no open ball centered at $(1,1,0)$ is contained in $D$.

On the other hand, $\left(\left(\frac1n,\frac1n,0\right)\right)_{n\in\mathbb N}$ is a sequence of elements of $D$ which converges to $(0,0,0)$. But $(0,0,0)$ does not belong to $D$. What can you deduce from this?