Understanding the theorem: Closed subset of a compact space is compact.

calculusmetric-spacesreal-analysis

The theorem in title can be proved as follows:
Let $F\subset E\subset X$ and suppose that $F$ is closed relative to $X$ and $E$ is compact. It is to be noted here that since $F=F\cap E$, $F$ is closed relative to $E$.
Let $\{F_a\}$ be an open cover of $F$, then clearly $H=\{F_a\}\cup F^c\supset E$ and since $E$ is compact, there exist a finite subcover $J$ of $H$ so that $J\supset E\implies J\supset F$. Hence, $F$ is compact.

My question is what happens when $F$ is closed relative to $E$ but not relative to $X$? Will $F$ still be compact?
Attempt: There exists a closed subset $D\subset X$ such that $F=D\cap E\subset D$. How do I take it from here?
Any suggestions, counterexamples? Thanks.

Best Answer

There is no need to reference $X$ at all. Everything works if you stay inside $E$ the whole time. One of the main ideas of subspace topology is to let you do things like this: Take a subset and pretend that that is the entire space you care about.

$F$ is closed relative to $E$, and $E$ is compact. Cover $F$ with opens (relative to $E$). Note that together with $F^c$ (complement relative to $E$), this forms an open cover of $E$, so it has a finite subcover. Take this finite subcover, remove $F^c$ if it's in there, and you have a finite subcover of the original cover. Thus $F$ is compact.