Two equal functions on a topological space Can anybody help please help me, I have to answer this problem in topology:
"Let $f$ and $g$ be continuous functions from the topological space $T$ into $\mathbb{R}$, with the usual topology. Show that $\{ x \in T \:| \:f(x) = g(x) \}$ is closed.
Also show that if $f(x)=g(x)$ for all x in some dense subset of $T$, then $f=g$ for all $x$ in $T$."
I hope someone can help me with this! Thank you. 
 A: Let $h:T\to\Bbb R$ be defined by $h(x)=f(x)-g(x)$. You should be able to show that $h$ is continuous. Your set is precisely the preimage under $h$ of the closed set $\{0\}$, so is closed by continuity of $h$.
If $S$ is a dense subset of $T$, then the closure of $S$ is $T$. But the closure of $S$ is the smallest closed subset of $T$ that contains $S$, and so if $S$ is a subset of the closed set in the first part (that is, if $f,g$ agree on $S$), then $T$ is the set from the first part, meaning $f=g$.
A: A nicer result can be seen as following:

Theorem: For any pair $f,g$ of continuous mappings of a space $X$ into a Hausdorff space $Y$, the set $\{x\in X: f(x)=g(x)\}$ is closed in $X$.

Proof: We shall show that the set $A=\{x \in X: f(x)\not=g(x)\}$ is open. For every $x \in A$ we have $f(x)\not=g(x)$; hence there exist in $Y$ open sets $U_1, U_2$ such that $f(x)\in U_1$, $g(x)\in U_2$ and $U_1\cap U_2=\emptyset$. The set $f^{-1}(U_1) \cap g^{-1}(U_2)$ is a neighbourhood of $x$ contained in $A$.
And hence, 

Corollary: For any pair $f,g$ of continuous mappings of a space $X$ into a Hausdorff space $Y$ with $f(x)=g(x)$ for any $x\in S$, where $S$ a dense subset  of $X$, then for any $x\in X$, $f(x)=g(x)$.

Proof: It is clearly to see that $S \subset \{x\in X: f(x)=g(x)\}$. By the above theorem, we can conclude that $\overline{S} \subset \{x\in X: f(x)=g(x)\}$, and hence $X = \{x\in X: f(x)=g(x)\}$. 
