Show that a metric space X is not connected if and only if there exists a…

Show that a metric space X is not connected if and only if there
exists a continuous surjection f : X → {0, 1}.