This is something that came up when I was studying something else, but I am wondering whether the following topological fact is true.
Let $X$ be a topological space, and $\{U_i\}_{i=1}^n$ a finite open cover of $X$. Let $A \subseteq X$ be a subset such that $A \cap U_i$ is closed in $U_i$ for all $i$. Then $A$ is closed in $X$.
(If this turns out to be false, is there a counterexample such that each $U_i$ is also dense in $X$?)
There is probably something simple that I am overlooking, so any help would be greatly appreciated.