A mushroom is a type of fungus. Other examples are yeasts and molds.
The nitrogen cycle could not exist without bacteria. Bacteria that lived inside the ground, catch the ntirogen that has been fixed and convert it into nitrate. This nitrate than used as a nutrients during photosynthesis from which the plants produce another fixed nitrogen and completed the cycle.