Continuous function $\geq 0$ on dense subset I'd like to use this fact, but I couldn't find out, how to prove it. Assume we have a continuous function $f : X \rightarrow \mathbf{R}$ with $X$ a topological space and $f \vert_D \geq 0$ on a dense subset $D \subset X$. Can I conclude that $f \geq 0$ on the whole space $X$?
I know that a function is uniquely determined by its restriction to a dense subset. But how can I use that to prove the fact? 
Thanks in advance!

Take $x\in X$. If $x\in D$, you done. If not, there exists $(x_n)\in D^{\mathbb{N}}$ converging to $x$, since $\bar{D}=X$. Then $$0\leq f(x_n)\xrightarrow[n\to\infty]{}f(x)$$
using continuity of $f$.
Edit: not sufficient for general topological spaces, cf. comment below. I'm leaving this answer here exactly because of this (I found the discussion in the comments useful, at least for me, to understand some of the concepts at play.)
