Mushrooms do go bad eventually.
If you have canned mushrooms that are in the metal cans and they are not opened the canned mushrooms should last 5 years or longer before going bad.
Opened cans of mushrooms will last for 3 to 4 days in the fridge before going bad.
Fresh mushrooms may last up to a week or 2 weeks before going bad.
Mushrooms when kept in the fridge will last for 3 to 4 days.
After 4 days the mushrooms will start going bad and should be thrown out as they can grow bad bacteria.
If you notice a bad smell to the mushrooms or they are getting slimy or have changed color then throw them out as they have gone bad.
You can freeze mushrooms and they will last longer.
When frozen the mushrooms will last for up to 6 months before they go bad.
I will sometimes freeze mushrooms to use later in soups and stews or in baking and they've lasted up to 6 months in the freezer.
The freezing temperatures of the freezer prevents bacteria from growing on the mushrooms and other food so they last longer.
You can put the mushrooms into a freezer safe container or Ziploc bags or freezer bags.