Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
@Marc Hoyois: The example you gave is not a counterexample, since $Z$ is supposed to be closed in $X$. But in your setup the only closed set contained in U is the empty set.
The scheme $X$ may indeed not be Noetherian, thus the connected components are not open in general. I added the qcqs condition so that quasi-components and connected components are the same, but I do not know whether this condition is needed.