Show that the set $\{x\in[0,1]\mid f(x)=g(x)\}$ is compact when $f,g$ are continuous I am trying to show that the set $S=\{x\in[0,1]\mid f(x)=g(x)\}$ is compact given that function f(x) and g(x) is continuous and the set $U=\{x\in(0,1)\mid f(x)>g(x)\}$ is open. I have no clue to approach.

Hint: Recall that $f-g$ is a continuous function. For the first show that $S$ is the preimage of a closed set, intersected with a compact set; for the second show that $U$ is the preimage of an open set, intersected with an open interval.
