The play that Bottom and the other artisans rehearse in the forest is performed for Theseus and Hippolyta and the four lovers in the closing scene of A Midsummer Night's Dream. This play within a play functions as a comic release, but is also a comment upon the role of the original (and later) actors of the Dream in relation to their audience.
Pyramus and Thisbe is the story of two lovers who are kept apart by a quarrel between their families. They agree to meet at a graveyard, but Thisbe, who arrives first, is surprised by a lion. She runs away and manages to hide in safety, but drops her mantle, which the lion worries. Pyramus arrives shortly afterwards, and finding the mantle, thinks Thisbe is dead. He kills himself in grief, and Thisbe, upon finding her lover dead, kills herself as well.
The Dream is generally accepted to have been written immediately after Romeo and Juliet, and Pyramus and Thisbe is a happily self-mocking parody of those "star-crossed lovers." (noted by several critics, among others Barber 1959: 152) However, critics have found other meanings in the play as well.
In the last few decades, many have pointed out the classism in the play's portrayal of the workers who perform the play.
The story of Pyramus and Thisbe is from Ovid's Metamorphoses, and it is available online at the Perseus Project. Shakespeare probably read the Metamorphoses in Golding's translation rather than in the original Latin, as certain words he uses are identical to words used by Golding.
The characters' mythological background.
The artisans' rehearsal of Pyramus and Thisbe in the woods, in III i 8-98.
The performance at the wedding ceremonies in the final act: VI i 108-334.