Reread Answers 1 & 2. And I would add that you should ignore the egregious, antiquated misconception that masturbation is bad for you and should be overcome. That's sheer bad advice and unnecessary masochism. There are absolutely no bad effects, either physically or psychologically, from (nonviolent) masturbation---quite the contrary.
I totally agree with Paxiled. There is nothing wrong with masturbation, aside from any religious reasons you may have for not doing it. Medically, there's nothing harmful in it, so long as it's not interfering in your normal daily activities.
You only get STDs by engaging in sexual activity with other people - oral, vaginal or anal sex.
I don't know why you are getting the pain, but you should definitely see your doctor about that. Masturbation wouldn't cause that. You don't even have to mention the masturbation to your doctor, since it's not a possible cause.
Take care.
Not sure what this has to do with STDs, which you get from having sex with other people under unprotected circumstances. Also don't think it could have anything to do with your pain, as masturbating isn't different than having manual sex with another person except the other person is absent. Some people become obsessive with things -- shopping, gambling, and sex are just some things people like so much they can get overly obsessed by them -- but whether one would benefit by stopping depends on whether the behavior is causing them harm. Are you feeling guilt from masturbating? Do you have relationships with other people? Masturbation is a perfectly normal thing to do and I don't know there is any age at which a person always starts or always stops. Some never get the urge to do it and some do it until they die. But if you want to stop and it's an obsession, you have to work on it, but maybe it's not the masturbation that is the source of your problem, maybe it's something else that's going on. As to the cause of your pain, can't say. A doctor might. Peace.