I tend to approach anything from several angles, including dreams. It helps me find the validity or usefulness of each approach, and it helps keep my mind open.
So what’s the function of dreams? They may help us process information and charged issues. They may bring our attention to processes in us right on the edge of being conscious. They may compensate for our conscious orientation and attitude. They may train us for situations we can encounter in waking life.
And, as a recent Guardian article suggests, they may help us get used to new and unfamiliar experiences. Dreams are often new and unfamiliar to us, so we get training in processing these types of situations.
I suspect there is some validity and usefulness to each of these views, and many more.
In any case, dreams are an expression of the creativity of the mind, and they show us certain characteristics of the mind.
Everything in a dream represents parts of our psyche, so by returning to the dream after we wake up, we can interact and dialog with these parts of us and get to know them, how they experience us and their world, and the dynamics between them and in our relationship with them. (Active Imagination.)
And, if we take it that way, they are a reminder that just like dreams, our waking life happens within and as consciousness. Dreams happen within and as what we are, as does our waking life. We can use the nature of dreams to find our own true nature.