A mushroom is a fungi. It does not synthesize its own food like plants do. Vegetative hyphae spread into the environment and absorb nutrients. Mushrooms were at first classified as plants, but they do not photosynthesize their own nutrients.
In many ways, fungi behave more like an animal. Fungi secrete digestive enzymes to break down organic material. Then they absorb the nutrients through their cell walls.
Simple sugars are their favorite food. Think of yeast used in brewing and baking. Yeast is a type of fungus that is very useful to us. It absorbs nutrients from the sugars in the flour and sugar. It gives off CO2 gas which causes the bread dough to raise.
We think of fungi as the waste disposal units in the natural world. Fungi are the decomposers.
The reproductive part of the mycelium is the mushroom cap aerial hyphae that we see in the grocery.