Q:

What function do myths serve in the Platonic dialogues?

There is a consistent pattern throughout the corpus of Plato's dialogues: first, Socrates proposes a philosophical problem, like "what is justice?" or "is there an immortal soul?". Then he goes on to challenge each attempt of his interlocutors at defining the concept or solving the problem. As the dialogue evolves, the reader is presented with the opportunity of gaining deeper and deeper insights into the problem. But at some point, the dialogue ends, leaving the question unsettled. And then, the style of the text changes and he starts narrating a myth, like the one depicting the fate of human souls after death, at the end of Phaedo.
How should we understand these closing myths? Are they the "correct" solution (from Plato's point of view) that could not be attained by the dialectic method? Or are these myths just a different approach to the problem that, although very useful, do not solve the problem, either?

A:

I'm far from an expert on the matter, but here's my take:
Overall, myths play a very large role in Plato's writings, and it seems to me that the closing myths serve as a sort of "Noble Lie," a concept discussed in The Republic. 
For example, the myth of Er in The Republic likely does not represent Plato's view on the matter (the myth being fairly arbitrary in the details of its epistemology in comparison to the rest of the book). Rather, I think it's something Plato would like the greater population to hear to understand his general idea on morality and perhaps even eschatology. 
From his writings, it's apparent that Plato believes in a soul, and the purpose of these myths is to encourage people who need motivation to work on improving their souls, with the promise of a good future after death. 
The Stanford Encyclopedia of Philosophy has a page on Plato's myths, and in part 6, comments that

He would have had strong reasons for avoiding the use of myths: they are not argumentative and they are extremely visual (especially those he invented, which contain so many visual details as if he would have given instructions to an illustrator). But he didn't. He wanted to persuade and/or teach a wider audience, so he had to make a compromise.

Similarly, the Internet Encyclopedia of Philosophy's page on the Phaedo, part 3 d., makes a note about the closing myth:

At the end of his tale, Socrates says that what is important about his story is not its literal details, but rather that we “risk the belief” that “this, or something like this, is true about our souls and their dwelling places,” and repeat such a tale to ourselves as though it were an “incantation” (114d).  Doing so will keep us in good spirits as we work to improve our souls in this life.  The myth thus reinforces the dialogue’s recommendation of the practice of philosophy as care for one’s soul.

In summary, the purpose of the closing myths in Plato's dialogues is likely to convey a message to the general public and educate them on his philosophy, and influence them to follow Plato's moral model. 

A:

Disclaimer: I am a student and not a scholar of Plato at this point.  I started reading his works in the order of the canon of Thrasyllus and only just finished Pheado myself.
According to G.M.A. Grube's introduction to Pheado the myth at the end ought to be compared to the ones in:

Gorgias
Republic
Phaedrus (Socrates' second speech)

The connective tissue of these four presentations of Homeric myth is eschatology: the study of final things.  For Greeks, that meant the separation of the soul from the body at death, the judgement of particularly heinous crimes, and the continued existence in Hades.  An Athenian citizen was expected to be well versed in these ideas—especially as told by Homer.  So it would be expected that Socrates, if he were a wise man, would be able to talk about these myths at length.
The charges against Socrates
It must be remembered that Socrates was dead when Plato, his student, wrote the dialogues he appears in.  Athens convicted Socrates of "failing to acknowledge the gods that the city acknowledges" and "introducing new deities".  Part of Plato's purpose in writing the dialogues was to clear his mentor's name.  (Ironically, the other charge against Socrates was "corrupting the youth".  Plato is Exhibit A.)  So having Socrates reconfirm the myths of the city helps show him as falsely-accused.  A contemporary reader might wonder if Socrates held orthodox eschatological view after all.
Pythagoreanism
We have evidence that Plato was strongly influenced by the cosmology of Pythagoras.  A principle tenet of the system was the transmigration of souls.  Unfortunately, that concept did not mesh well the Illiad and the Odyssey where death was final and souls were doomed to wander shadowy Hades forever.  There was no hope for a soul to return.  In Pheado, Plato is eager to show that souls return to new bodies if they were not either especially evil (so receive everlasting torment) or especially philosophical (so receive everlasting peace).  In order to show that Socrates (or Plato himself) did not dishonor the existing cosmology, Plato reworked the existing images of the afterlife to fit with reincarnation.
In addition, Plato's epistemology depended on anamnesis.  Since people already know things from birth, it follows that we must remember them from our preexistence as disembodied souls.  Naturally, our souls would have needed to have access to practical knowledge (common sense) in addition to esoteric knowledge.  Therefore, our souls must have had bodies in "previous lives".
Purpose of myth
It's difficult to know if either Socrates or Plato believed there was such as person as, say, Zeus.  My guess is that neither were particularly pious in the traditional, Greek sense.  It seems that both were far more interested in obtaining philosophical truth than in honoring the gods.  But Plato, at least, was also interested in using myth to communicate truth.  In the Republic (which seems to be 100% platonic and 0% socratic), we read the allegory of the cave which compares our view of the world to shadows on the wall of a cave.  Technically, there is no cave and no fire and no shadows and no prisoners.  The whole story is bogus if you try to take it literally.
But the story does neatly illustrate Plato's point which Paul of Tarsus summarized neatly:

1 Corinthians 13:12 (HCSB)
12 For now we see indistinctly, as in a mirror,
  but then face to face.
  Now I know in part,
  but then I will know fully,
  as I am fully known.

As we struggle to understand the reality of the world (and of ourselves) we need to use language that bridges the gap between what we can understand and what we want to understand.  At the time, myth was the state-of-the-art tool for accomplishing this feat.  (Today, mathematics has shown itself to be a powerful alternative.)

