Excellent question! Although many dream researchers believe that dreaming has a biological or adpative function, some argue that dreams are merely a by-product (a sort of epiphenomenon) of basic neurophysiological activity occuring during sleep. That said, theories about the possible function of dreams abound. Among the most scientifically interesting ones are that dreams a) play a role in emotional regulation; b) help consolidate memories; and c) have an evolutionarily-based threat or social simulation function. In our recent book, When Brains Dream, Robert Sickgold and I propose that dreaming allows the sleeping brain to enter an altered state of consciousness in which it can construct imagined narratives and respond emotionally to them. While dreaming, the brain identifies associations between recently formed memories (typically from the preceding day) and older, often only weakly related memories, and monitors whether the narrative it constructs from these memories induces an emotional response in the brain. So the dreaming brain takes these associated memories and concepts and weaves them into a story—a narrative that plays out over time—where you, the dreamer, have the lead role. And it watches the 'you' in the dream react emotionally to the ongoing plot. It's your feelings in the dream that are critical. The brain's rule seems to be that if the story woven with this new association evokes an emotional response in the dreaming 'you', then it's worth keeping. Put differenlty, we thing that for the sleeping brain to explore possible new ways to think about the events of your day—to understand the meaning of what happened in your day and how to use that new understanding—you have to dream.