Mushrooms are good but onions are simply indispensable. Sauces, salads, soups, hotpots,roasted meats, legumes etc it is impossible to cook and not have onions in your kitchen. Spring green onions, white onions or red onions. More than half the lunches/dinners I cook every week have onions in it. Mushrooms? Only in some sauces and pizzas or once in a blue moon have some grilled preulotus mushrooms with balsamic vinegar as main dish.
Onions. As other posters noted they enhance other flavors. Also Onions make better satire. https://www.theonion.com/
Hmm. I like onions as part of fajita dishes and some soups. Straight up onions on like burgers and stuff? Nah. Mushrooms, sure.
Onions are a staple in Mexican cuisine so I'd miss onions the most if they went extinct. Mushrooms go hard in some Mexican dishes, though.