What is a real life example of a function?
Suppose you start measuring your height every day, starting today.
You will accumulate a set of pairs consisting of one date and one height.
On one hand there is the set of dates that starts with today and stretches out into the future. On the other hand there is the set of height that you might assume. If you are young then this set might consist only of numbers that are bigger than the one that you record for today. However, if you are fairly old, and becoming a little bit shorter with age, then the numbers in the set might be becoming smaller. In any case the second set will consist only of heights.
The function is the set of pairs that takes one date in the first set and 'maps' it (or connects it) to a height in the second set. The function is the complete set of pairs that you have accumulate thus far.
The diffraction of light in the real life can be seen as a rainbow pattern on a DVD or CD. The closely spaced tracks function as diffraction grating. A credit card's hologram is another example diffraction light application in real life. The grating structure on the card produces the desired diffraction pattern.