Suppose $f:[a,b]→\mathbb R$ and $g:[a,b]→\mathbb R$ are both continuous. Let $T=\{x|f(x)=g(x)\}$. Prove that T is closed. In a previous homework problem, I proved that $[a,b]\subset \mathbb R$ is closed. Therefore, in the case that $f(x)=g(x)$ for all $x\in [a,b]$, then $T=[a,b]$ which is closed by a previous proof. I'm allowed to cite that problem in my work. Since, the greatest case is $f(x)=g(x)\space \forall x\in[a,b]$ and T would be closed-- $T$ can only become a smaller set from this point on. However, I think this problem is trying to get us to prove that any subset of a closed set, is also closed. I don't know if this is true, but this is what my intuition is telling me the problem actually is. 
I don't know how to write a proof saying that maybe card$T$ is finite and so its a subset of the greater $T$ mentioned earlier which is closed so it must be closed. However, if we look at $f(x)=x^2$ and $g(x)=x$ which have two intersection points. In this case, $T=\{0,1\}$ and so looking at the definition of a closed set, it requires that every accumulation point of the set, belongs to the set. Digging further, looking at the definition of an accumulation point, $0,1$ can only be accumulation points iff every neighborhood of $0$ or $1$ contain infinitely many points in $T$, but $T$ is not infinite. Leading me to think that maybe every subset of the "greater" closed $T$ mentioned earlier is not closed. 
I'm not sure where to go from here.
 A: $T= \{x \in \mathbb R \mid (f-g)(x)=0\} = (f-g)^{-1}(\{0\})$, i.e. $T$ is the inverse image under $f-g$ of the singleton $\{0\}$. As $\{0\}$ is closed (a singleton set is closed) and $f-g$ continuous, $T$ is closed.
A: Let $(x_n)$ be a convergent sequence in $T$ with limit $x_0$. You have to show that $x_0 \in T$.
To this end use


*

*$f(x_n) =g(x_n)$ for all $n$,

*$x_0 \in [a,b],$

*$f(x_n) \to f(x_0)$ and $g(x_n) \to g(x_0).$
Can you proceed ?
A: $h(x):=f(x)-g(x)$, $h$ is continuous.
$T=${$x| h(x)=0$}.
Then $T= h^{-1}${$0$}  is closed being the inverse image of the closed set {$0$}.
A: Suppose $y\in[a,b]\setminus T$. Then $a:=|f(y)-g(y)|\gt 0$. As $f$ and $g$ are continuous,  we can find a $\delta\gt0$ such that $$|f(x)-f(y)|\lt \frac a3,\:|g(x)-g(y)|\lt \frac a3$$whenever $|x-y|\lt\delta$. So if $|x-y|\lt\delta$, by triangle inequaltiy, $$\begin{align*}a=|f(y)-g(y)|&\leq |f(y)-f(x)|+|f(x)-g(x)|+|g(x)-g(y)|\\&\lt\frac a3+|f(x)-g(x)|+\frac a3\end{align*}.$$ So $|f(x)-g(x)|\gt \frac a3\gt 0$ whenever $|x-y|\lt\delta$. This shows that $[a,b]\setminus T$ is open in $[a,b]$. So $T$ is closed. 
Observe that if $T$ is dense in $[a,b]$, $f\equiv g$ in $[a,b]$.
