Show that the set $\{ x \in [ a,b ] : f(x) = g(x)\}$ is closed in $\Bbb R$.

Let $f : [a,b] \to\Bbb R$ and $g : [a,b] \to\Bbb R$ be two continuous functions on $[a,b]$. Show that the set $\{ x \in [ a,b ] : f(x) = g(x)\}$ is closed in $\Bbb R$.


HINT: Let $h(x)=f(x)-g(x)$. Prove:

  1. The function $h$ is continuous.
  2. $\{x\in[a,b]:f(x)=g(x)\}=h^{-1}[\{0\}]$.
  3. $\{0\}$ is a closed set in $\Bbb R$.

This is equivalent to Brian's answer. Let $A = \{x \in [a,b]: f(x) = g(x)\}$.

Consider a sequence of points $\{x_n\} \in A$ converging to $x \in [a,b]$. (Note that the existence of $x \in [a,b]$ is guaranteed since $[a,b]$ is a closed set. We need to prove that $x \in A$ to prove that $A$ is closed.)

Continuity also implies sequential continuity. Hence we get that $$f(x) = \lim_{n \rightarrow \infty} f(x_n) = \lim_{n \rightarrow \infty} g(x_n) = g(x).$$

Hence, $x \in [a,b]$ and also $f(x) = g(x)$. Hence, $A$ contains its limit points. Hence, $A$ is closed.