There are three boxes, one contains only apples, one contains only oranges, and one contains both apples and oranges.
The boxes have been incorrectly labelled such that no label identifies the actual contents of the box it labels.
Opening just one box and without looking in the box, you take out one piece of fruit.
By looking at the fruit, how can you immediately label all of the boxes correctly?
Take one piece of Fruit from the box which is labelled "Apples and Oranges".
(we know that all labels are incorrect)
So if you get Apple, you know that this box contains only Apples, so the box labelled Oranges would contain both and box labelled Apple will contain Oranges.
Similarly if you get Orange, you know that this box contains only Oranges, So the box labelled Apples would contain both and box labelled Oranges will contain Apples.
So you can label all the boxes correctly.