Emergency Method of Walking a Short Distance on Ice Without Slipping:
If you find yourself on ice unexpectedly and you don't have far to go, an emergency option is to remove your shoes/boots entirely and walk in your stocking feet. This is obviously not a good idea if you're not going to be indoors within a couple of minutes, but if you're just walking from the car to your house, it works quite well.
The idea is that your body heat can pass through the socks, melting the top layer of ice. Your socks absorb this melted ice, but immediately refreeze, which means that your sock is now glued to the ice. The adhesive properties aren't strong enough to keep you from moving, so you can simply take another step, your sock sticks to the ice again, and so on.
Low Cost, DIY Solution:
A more long-term solution is to get an old pair of boots with thick soles, preferably with the treads still more or less intact. Buy some short wood screws with rounded heads and screw them into the soles of the boots. Obviously, you have to make sure that the scres aren't so long that they go all the way through the sole and into your feet. Arrange the screws in a grid pattern, with maybe an inch or an inch and a half between them.
If the boots are the slip-on/slip-off variety, you can easily put them on and take them off when entering and leaving buildings. Be careful not to wear them on wood or tile floors, because the screws will damage hard surfaces.
This is basically the way old fashioned hobnail boots worked, and it still works today. All together, the materials shouldn't cost more than a few dollars, and if you already have an old pair of boots, the cost will be no more than a dollar or two.
The Best Way to Walk on Ice:
You will slip less if you don't lift your feet at all. Pretend you're ice skating, and slide instead of walking. The reason this works is that you are keeping the largest possible surface area of your feet in contact with the ice, which provides the maximum amount of friction. Since ice and friction don't like each other, this technique isn't foolproof, but in the absence of any better options, it is the best you can do.
The next best option is, as previous answers have already said, to take baby steps. The shorter your stride, the less momentum you have, and it is less likely that you will go ass over elbows. Move as slowly as you can, and keep your feet close together.