If we have a scheme and a locally closed subset of the underlying topological space, then there is a canonical way to put a scheme structure on it so that the inclusion map can be upgraded to a morphism of schemes with the map on the structure sheaves $\mathcal{O}_X\rightarrow f_*\mathcal{O}_U$ being surjective.
I think this is not true for e.g. finite disjoint unions of locally closed subsets (take the affine plane and the complement of the punctured axes); correct me if I am wrong.
However, in the example above there is a scheme structure on the subset under consideration. We just can not choose it compatibly with the scheme structure on the affine plane.
Which brings me to the question: are locally closed subsets somehow "the most general" class of subsets that can be functorially endowed with a scheme structure so that the inclusion map can be upgraded to a morphism of schemes with the map on the structure sheaves being surjective? Or are there more general subsets with this property?