Although not a perfect test, looking at the cloves is the best way to tell if your garlic has gone bad. Some common traits of garlic going bad are brown spots on the cloves and the color of the cloves changing from white to a yellowish-tan. Product at this stage will taste hotter.
Can you eat garlic if it's brown?
Obviously, you don't want to eat moldy or mushy garlic, but sprouts cloves or even those that have browned or yellowed spots can still be used. Their taste might be slightly off, but removing the green sprout or trimming browned spots will make older cloves usable and keep them out of the trash.
Why are my garlic cloves Brown?
Spoiled garlic forms brown spots on the cloves and turns from the usual white to a more yellow or brown color. Another thing is the green roots forming in the center of the clove. These are new sprouts forming. Though not harmful these roots taste extremely bitter and should be removed before cooking.