TITLE: Any collection of neighborhoods of a dense set cover the space?
QUESTION [7 upvotes]: Trying to solve an exercise, I'm trying to see if this is true:

Let $X$ a Hausdorff space and $D\subset X$ dense. Also let a function $$f:D\to\wp(X),\quad x\mapsto U_x$$ where $U_x$ is a neighborhood of $x$. Then we can say that $X=\bigcup f(D)$?

I'm unable to prove it so probably it's false. My first idea was taking each $U_x$ open, then $U:=\bigcup f(D)$ is also open and $U^\complement$ closed. Then if my assertion would be true, it must be the case that $U^\complement=\emptyset$, but I'm unable to show this.
Can someone confirm if there exists some Hausdorff space where my hypothesis doesn't work? Or, by the contrary, if my hypothesis is true?

REPLY [9 votes]: If $y\notin D$ then you can choose for $U_x=X-\{y\}$ for every $x\in D$ - which is evidently an open neighborhood of $x$ in Hausdorff space $X$. 
Then the union of these sets is again $X-\{y\}\neq X$.
Apparantly that statement is false already if $X$ is a $T_1$-space.