What part do Bottom and the other "rude mechanicals" have in A Midsummer Night's Dream?
Good question. The rude mechanicals have many parts/functions.
Mostly simply, they provide humor.
They also provide a different kind of humor. Bottom's egotism is distinct from the slapstick of the lovers.
They provide perspective on the love affairs of the play. The young lovers could have ended like Pyramis and Thisbe, but instead, the fairies intervened.
They provide perspective on theater; consider the last act.
Bottom is a tool through which Oberon can torment Titania.
Finally, they show the play reaching to society's lower levels, as the king shows it reaching to the upper.
The rude mechanicals are mostly there for humor. For instance Bottom gets an ass's head on him and Titania falls in love with him. I encourage you to watch a production of it; incredibly entertaining. They're something for Puck to mess around with. I believe in Act 2 or 3 he actually intervenes in their play and makes a mess of it.
They have been enlisted to perform on stage as part of entertainment at the marriage between Theseus and Hippolyta. They consists of Quince (director), Flute, Snout, Snug, Starveling and Bottom