How to know whether the whole unpeeled garlic is still edible or not?
There are three signs you want to look for on garlic that indicate you may not want to use it:


Signs of mold, especially black mold.  Discard the garlic.
Soft to finger pressure.  It is rotten.  Discard.
Sprouted.  While it is still safe to eat (if it doesn't have other issues), it may be bitter.


Good garlic should be quite hard when pressed with your fingers, and preferably is not sprouted.  Some people even remove the green core of partially or beginning to sprout garlic when they prep.