Let $(X, \tau )$ be a topological space and let $A \subset X$ be a closed subset. Let $X/A$ be equipped with the quotient topology, and let $\pi : X \to X/A$ be the canonical projection (by collapsing $A$ to a point in $X/A$).
If $U$ is an open subset of $X$ such that either $A \subset U$ or $A \cap U = \emptyset$, show that $$ \pi^{-1} (\pi(U))=U.$$
We wish prove that $ \pi^{-1} (\pi(U))=U$ via mutual inclusion. Suppose first that $x\in U$, we then see that $\pi(x) \in \pi(U)$. We look at what the inverse image means for $S=\pi(U)\subset X/A$: $$\pi^{-1}(S) = \{ z \in X | \pi(z) \in S \}.$$ $$\pi^{-1}(\pi(U)) = \{ z \in X | \pi(z) \in \pi(U) \}.$$ We see that $x\in U\subset X$ and indeed $\pi(x) \in \pi(U)$, so we have that $ x \in \pi^{-1}(\pi(U))$. We have our first inclusion: $$U\subset \pi^{-1} (\pi(U)).$$ This was the easy direction I think. This is just a set-theoretic notion and this inclusion always holds, we did not use any properties.
Now we would easily get the other direction via injectivity of $\pi$ (it is always surjective, but not injective since it collapses all of $A$ to a single point), but somehow the conditions imply that $U\supset \pi^{-1} (\pi(U)).$ It seem to, in a sense, be "injective on $U$" if I am interpreting this correctly, but I do not see how to get the inclusion out of the assumptions.
If $A\cap U=\varnothing$, you can easily check that $\pi\upharpoonright U$ is injective and hence that $U=\pi^{-1}\big[\pi[U]\big]$.
Now suppose that $A\subseteq U$, and let $\pi[A]=\{p\}$, so that $\pi(x)=p$ iff $x\in A$. Then $\pi\upharpoonright U\setminus A$ maps $U\setminus A$ injectively to $\pi[U]\setminus\{p\}$, so
$$\begin{align*} \pi^{-1}\big[\pi[U]\big]&=\pi^{-1}\big[\pi[U\setminus A]\big]\cup\pi^{-1}\big[\pi[A]\big]\\ &=(U\setminus A)\cup\pi^{-1}[\{p\}]\\ &=(U\setminus A)\cup A\\ &=U\,. \end{align*}$$