After I shave my legs I have dots where the hair used to be. How can I get rid of them and what are they?

Folliculitis. This is called folliculitis and is caused by constant shaving. There could be irritation or infection of the hair follicles. This can be treated with topical or oral antibiotics. Cleaning or changing the razor frequently also helps. If it keeps recurring despite using clean razors, then a longer term solution would be laser hair removal.
Conditioner. Peri follicular irritation is usually from shaving with soap or some sort of chemical irritant. I recommend shaving with conditioner, any inexpensive brand is fine, or with cerave cleanser (non-foaming). I agree with dr. Strickland's other modifications, and if all these things fail, multiple sessions of laser hair removal in experienced hands will work.
Change razor. I see this frequently in ladies that use the same razor repeatedly. The razor harbors bacteria and when you shave you inoculate the hair follicle with the bacteria which allows it to infect and grow giving inflammation. I have seen this scar in some women. Clean the razor carefully, store the blades in rubbing alcohol and change to new razor frequently. Treat the bumps with topical antibiotic.