Hey these dots look like they could be build up of keratin debris under the nail. I would suggest you try some sort of nail fungus treatment or go see a doctor, usually this sort of stuff nail fungal business is on the toenails. Any topical treatment containing camphor or some sort of analgesic should help with the soreness pain and look for tea tree oil as well. What treatments have you tried so far? There are some treatments broken down by ingredients at Toenail Fungus Reviews
that will work for fingernail fungus as well, look at the ingredient comparison or some of the pictures, it looks like you can match up your condition. There are some home remedies that also involve cayenne pepper and vinegar if you are in a pinch. I hope this helps, I've been there.