Wake-up World says:
You can re-grow a plant from just a single clove – just plant it, root-end down, in a warm position with plenty of direct sunlight. The garlic will root itself and produce new shoots. Once established, cut back the shoots and the plant will put all its energy into producing a tasty big garlic bulb. And like ginger, you can repeat the process with your new bulb.
Onions are one of the easiest vegetables to propagate. Just cut off the root end of your onion, leaving a ½ inch of onion on the roots. Place it in a sunny position in your garden and cover the top with soil. Ensure the soil is kept moist. Onions prefer a warm sunny environment, so if you live in a colder climate, keep them in pots and move them indoors during frostier months.
As you use your home-grown onions, keep re-planting the root ends you cut off, and you’ll never need to buy onions again.