Continuous Functions and dense set Let $X$  be a topological space and $D\subset X$. If for every $f,g\in C(X)$ we have $f(x)=g(x)$ for all $x\in D$ implies $f=g$. 
Then $D$ is a dense subset of $X$.
 A: It’s not true without additional assumptions. There are non-trivial $T_3$ spaces on which every continuous real-valued function is constant. Let $X$ be such a space, and let $D=\{p\}$ for any $p\in X$. Then $D$ is very far from being dense, but if $f,g\in C(X)$ and $f(p)=g(p)$, then $f=g$.
You need the additional assumption that $X$ is completely regular. Suppose now that $D$ is not dense in $X$; then $\operatorname{cl}D\subsetneqq X$. Let $V=X\setminus\operatorname{cl}D$; $V$ is a non-empty open set, so we can choose a point $p\in V$. Since $X$ is completely regular, there is a continuous $f:X\to[0,1]$ such that $f(p)=1$ and $f(x)=0$ for every $x\in\operatorname{cl}D$.


*

*Can you find continuous function $g:X\to[0,1]$ that is different from $f$ but that also has the property that $g(x)=0$ for every $x\in\operatorname{cl}D$?


If you can, you’ve proved the result (in it’s contrapositive form): if $D$ is not dense in $X$, then there are distinct functions $f,g\in C(X)$ that agree on $D$.
