The difficulty with this question is that introduction of menus happened at the same time as the invention of the restaurant, by definition. So instead I'll explain how restaurants and menus came to be and hopefully answer the original question in the process.
People have been able to go out in public and purchase prepared food for millennia, from street vendors, taverns, bakers, inns, etc. There wasn't, however, much control over what you could eat- they'd serve you whatever meal they had prepared that day or whatever specific foodstuff they sold. But the restaurant- a place you can go to eat and choose from among many options of food, (that might be then specifically prepared for you if necessary) is a relatively modern creation. The oldest continuously operating restaurant in the world (according to Guinness, at least, so take with a grain of salt) is Restaurante BotÃn in Madrid, which dates back to 1725. This coach house turned restaurant followed a similar evolution during the 18th century to many other eating establishments- especially those in France, which usually takes credit for inventing the restaurant. So how did that happen?
The earliest French establishments that called themselves restaurants sold a variety of restorative broths. The right to sell any more complex dishes or pieces of cooked meat, however, was held by the guild of the traiteurs, who essentially operated as private caterers. But that monopoly was challenged by the restauranteurs- in a long repeated narrative that borders on legend (as modern historians have been unable to find corroborating documents) a restauranteur named Boulanger started selling sheep feet in a broth. The traiteurs saw this as a threat and sued Boulanger, but lost the case and he was allowed to serve stew after all. With the monopoly effectively broken, both restauranteurs and traiteurs could serve whatever they wanted, and the modern restaurant was born. But while Boulanger, if he existed, served pretty modest chow, in 1782 Antoine Beauvilliers opened La Grande Taverne de Londres (in Paris). This was the first eating establishment that had all the hallmarks of a fine dining restaurant- options of what to eat, waiters, an extensive wine cellar, and an elegant dining room.
Of course, within a decade of the opening of Beauvilliers' restaurant, all sorts of social unrest came to a head in the French Revolution- one of the results of which was that it fueled a restaurant boom. For most of history, the elite or nobility had private cooks. There was little demand for a sophisticated public dining establishment, as virtually all those who had the resources to eat there already would have already had chefs in their homes. But then the Revolution (somewhat literally) chopped the head off of French society (leaving a number of unemployed chefs), and pushed the development of the middle classes, who could afford a restaurant now and then, but could not afford a full time chef.