Let $p:\ X\to Y$ be a closed continuous surjective map such that $p^{-1}(\{y\})$ is compact for each $y\in Y$. Show that if $Y$ is compact, then $X$ is compact.
It is written
Let $U$ be an open set containing $p^{-1}(\{y\})$. Since $X-U$ is closed, $p(X-U)$ is closed in $Y$. Then $W=Y-p(X-U)$ is an open set that contains $y$. Since $(X-U)\cap p^{-1}(W)=\varnothing$, $p^{-1}(\{y\})\subset p^{-1}(W) \subset U$.
My confusion :why $p^{-1}(W) \subset U ?$ why not $p^{-1}(W) = U ?$
My thinking : $W=Y-p(X-U) \implies p^{-1}(W)=p^{-1}(Y) - p^{-1} p(X-U)$
since $p^{-1}(Y)=X \implies p^{-1}(W)=X - (X-U)=U$
Therefore $p^{-1}(W)=U$