Q: Is there such a thing as reward and punishment in this world?
A: It says that the schar, the reward of a mitzvah is the opportunity to do another mitzvah which will make a person earn even more olam haba! It's like if someone does a good job at work - they are paid for it anyway, but what does his boss do? He raises them to a higher position in their office so then they pay goes up as well! More opportunities means more reward!
I don't like to think of pain as a punishment, rather, I look at it as a kapparah, an atonement, for something a person may have done wrong and it's giving them a chance to erase their aveiros and turn them into mitzvos by using their painful experiences as a wake up call to change and become better! This is such a chessed from Hashem! Instead of waiting until the person comes in front of Him (after 120 years) to give a din v'cheshbon - an accounting - for each thing they did wrong in their life, Hashem gives them a chance to correct their misdeeds and change - all while they are still alive! What a gift this is!!