YES! you can compost it and use it for fertilizer!
It depends on what food it is. The fungi will probably get food from the fridge rotting in a day or two but otherwise, I don't really know.
raw and rotting eggs
Yes, it is possible to prevent food from rotting by storing it properly. This includes keeping food at the correct temperature, using airtight containers, and avoiding exposure to light and moisture. Additionally, maintaining good hygiene practices can also help prevent food from rotting.
rotting stuff in garbage cans.
Because inside it is rotting food.
If given the opportunity and it smells good yes a cat will eat rotting food. It would even eat out of a trash can if it could. Not all would but most would.
They brake down waste and rotting matter.
asparagus
It moves ingested materials through the alimentary canal at a consistent rate preventing material from rotting.
When food spoils or rots, it is best advised if it is tossed in the garbage.
a toadstool does but a fern does not. a fern makes its own food
well once you have cooked the food it is ready to it so there is no need to preserve it