I encountered the following problem in James Dugundji's Topology (Chapter XII, section 2, problem 4):
Let $Y$ be compact, and $F\subseteq Z$ closed, and $G\subseteq Y$ open. Prove that $$\mathcal{O}:=\{f\mid f^{-1}(F)\subseteq G\}$$ is open in $Z^Y$.
Here $Z^Y$, the set of continuous functions from $Y$ to $Z$, carries the compact-open topology, that is, the one that has for subbasis the family $\{(C,V)\mid C\text{ is compact in }Y \land V\text{ is open in }Z\}$ (where $(C,V)=\{f\in Z^Y\mid f(C)\subseteq V\}$).
The reason I'm stuck: Let $f\in \mathcal{O}$, I'm trying to find a compact $C$ and a open $V$ s.t. $f\in (C,V)\subseteq \mathcal{O}$. The thing is that the statement $f\in (C,V)$ restricts the value of the output for a given family of inputs but the statement $f^{-1}(F)\subseteq U$ restricts the values of the inputs that lead to a certain family of outputs. So I don't see how to find suitable $C$ and $V$.
I'm looking for hints or solutions to the problem.
btw: this section comes prior to the one that proves that, when $Y$ is compact, the uniform topology and compact-open topology in $Z^Y$ coincide so this shouldn't be used.