There is some research that REM sleep helps facility memories. They reflect the on-going, daily activities. So dreams provide the brain with periodic stimulation. Dreams are just the brain's way of making sense of random neural activity. The brain transmits a pattern of signals to the cerebral cortex and the cortex attempts to integrate the signals into a dream plot, but has difficulty because the information is random.
Dreams are just bits of the process of the mental clean-up that is taking place.
For the next week, you are to keep a dream journal. When you wake up, write down what your dream was about. The Sleepnet site lists a number of different sleep problems. Describe 3 of the following disorders - sleep apnea, insomnia, narcolepsy, restless legs, sleep terrors, sleep walking. Make sure you describe symptoms, causes, etc.