I have unit intervals given such as $I = \{\{s_1, s_1 + 1\}, ..., \{s_k, s_k+1\}\}$ ($\forall s_i \in \mathbb{R}$). I am given a list of $X$ reals, such that each of the reals belongs to at least one interval.
I am asked to suggest a greedy algorithm to minimize the number of intervals required to capture all reals from $X$.
My attempt: Sort intervals by starting (or equivalently finishing) time. Sort numbers in $X$. Then, for the first entry in (sorted) $X$, place it in the latest intervals that can catch it. Then check if the next element of $X$ fits in this interval, if not, place in the latest interval that can catch it.
Questions that arised: how can I prove the correctness of my algorithm?