Stav dette: Induced subgraph density. II. Sparse and dense sets in cographs