You can take painkillers before exercising, but it is not recommended as it can temporarily mask the pain.