Are vegetables poisonous if they have roots, are sprouting or are many weeks old?
I'll second NBenatar but with a bit more info:

Carrots, onion, and garlic aren't dangerous when they sprout but they use their sugar reserves to make the sprout. They go downhill very fast and get rubbery and unusable. Whenever garlic or onions sprout I just plant them and use the greens instead.

Potatoes are a little different. Even after sprouting they can still have usable parts for some time. The green portions of a potato are toxic (not enough to be scary but I've heard they will make you sick if you eat enough). It's worth cutting away the green parts if the potato isn't soft yet.