Let $A = (Q, \delta, q_0, F)$ a DFA that accepts $L$. For $q, q' \in Q$, define:
- $L_{q,q'} = \{u\in \Sigma^*, \delta^*(q, u) = q'\}$;
- $L_{q',F} = \{u\in \Sigma^*, \delta^*(q', u) \in F\}$.
It is quite easy (can you prove it?) to see that those languages are regular.
Now the language $\{x\in \Sigma^*\mid \exists w\in\Sigma^*, xww\in L\}$ can be written as:
$$\bigcup\limits_{q\in Q}L_{q_0,q}\cdot M(q)$$
Where $M(q) = \left\{\begin{array}{rl}\emptyset&\text{if }\bigcup\limits_{q'\in Q}L_{q,q'}\cap L_{q',F}=\emptyset\\\{\varepsilon\}&\text{otherwise}\end{array}\right.$
$M(q)$ is regular since it is either $\emptyset$ or $\{\varepsilon\}$, so that means that $Z(L)$ is regular.