I was reading the construction of Cantor-Lebesgue function in Ziemer's Modern Real Analysis (Page 124). Apparently, this function maps the Cantor set $C$ onto $[0,1]$. Ziemer gives the following argument:

I understand why $f(C)$ is compact and why $f([0,1]\setminus C)$ is countable, but I can't understand why this facts imply the statement.
Since $f([0,1])=[0,1]$, $f(C)\supseteq f([0,1])\setminus f([0,1]\setminus C)$ contains all but countably many points of $[0,1]$. Since every nonempty open set in $[0,1]$ is uncountable, this means $f(C)$ is dense in $[0,1]$. Since $f(C)$ is compact and hence closed, this implies $f(C)=[0,1].$