A scattered space is a space for which every not empty subset has an isolated point (equivalently for $T_1$ spaces, every not empty closed subset has an isolated point).
A compact Hausdorff, not scattered space can be continuously mapped onto $[0,1]$. Conversely if $S$ is a compact Hausdorff, scattered space and $f$ in $C(S,[0,1])$ a surjection, how can a contradiction be derived?