I never fool around with ANYTHING that looks suspicious -- I've had food poisoning three times in my life, and I don't want to repeat it. Discoloration MIGHT be due to just a transfer of the color from the green beans to the garlic, but it could be something more serious. If you don't know for sure, dump it!
Garlic is dangerous in certain situations because it can be a prime breeding ground for deadly botulism
, and improper home canning is a source of botulism poisoning. I understand that botulism in garlic is primarily a problem when it's stored in oil, but I suspect it could also occur if the canning was not properly done (inadequate heat, not heated long enough, etc.).
I'm only guessing here, but I strongly believe that one should be very cautious when it comes to food and possible contamination. When in doubt, throw it out!