It depends. There is a difference between a sore muscle and an injured muscle. Sore muscles will often feel better once you start to warm up and begin exercising. An injured muscle will continue to hurt and will cause actual pain, rather than just discomfort. If you are in pain, it is probably best to skip a workout and give your body a day of rest to see if the pain will go away quickly. If it doesn’t, consider seeing a doctor.
Keep in mind, that when you workout very hard, especially in the beginning, you will likely have very sore muscles. You will often be more sore the 2nd day after a workout than you were on the day of or the day immediately after your workout. This is normal. Consider doing some active recovery consisting of exercises done at a lower intensity. This can sometimes speed the recovery process.
Always incorporate rest days into your workout program. Your body needs rest days to heal. Recovery is why you get better!