The best idea may be to take a few days off to see if the pain subsides. If you don't want to do that then all I can say is try lifting lighter. You say you don't want to take time off, but if you don't pay attention to the signs it could turn into something serious. Only you can tell what your body is trying to tell you. You ask if there is a way to prevent injuries... Well there are many way.. Number one is make sure you warm up well before you workout. Lift light at first and use proper motion and form. If you lift bulk and very heavy, do it in cycles. Sometimes your body needs a break... Its like a machine, you can't just keep working the hell out of it over and over and over without a break, or it will break. Like nitrous oxide on a car, you can only hold it the nitrous for so long.