Let $X$ be a topological space. For any $A \subseteq X$, consider two possible conditions on $A$:
1) $A$ is open in $X$;
2) $A \cap K$ is open in $K$, for each compact set $K \subseteq X$.
Then $(1)$ implies $(2)$. but, necessarily $(2)$ doesn't imply $(1)$. Give an example of $A$ such that $A$ satisfies in $(2)$ but $A$ is not open in $X$.
Take $X$ to be an uncountable set with the cocountable topology (a set is open if and only if its complement is countable). You can verify that the compact subsets of $X$ are finite sets with the discrete topology.
Hence, take any $A\subseteq X$ that is not open. Then, for any compact $K\subseteq X$, $A\cap K$ is open in $K$.