Don't hurt yourself. It may be fun to play, but the idea is that you are working on a skill that has the potential to keep you amused for the rest of your life. It is hard to do that if you injure yourself in the process. In my experience, if it hurts, stop and wait until you don't feel the pain. The way you describe you symptoms makes it sound like an over use issue. Rember everything is conected to everthing else. If something is sore your body attempts to compensate for the hinderance by work in ways that are not efficent. This can cause cascading pain in diffrent parts of your body.
As to the pain... Ibuprofen and ice can be helpful. Stretching before you play is helpful. But most importantly listening to what your pain is saying is the real key.
Have you looked at smaller guitars (this could be a big diffrence)? Have you studied how to hold the guitar? Do you use a strap? Sitting or Standing. Electic or accoustic guitar? All of this stuff matters.
Maybe try slowing down on the physical practice and watching some more vidieo lessons on these topics when you have pain. Pain can actually be your friend as long as you listen to it when it starts and take it easy until what ever is causing the pain subsides. The trick is to listen closely to what you body is telling you. Guitar should not cause you the pain you describe.
I have seen people video themselves and send it in to one of the instructors. They are adept at teaching guitar and your complaints sound like that could be a productive approach.
Rember music is supposed to be fun.
Captcha is a total pain in the........