Pain is present after an injury due to inflammation - the body's response to an injury. The swelling is probably caused by tiny broken blood vessels and squashed tissue cells burst in the injury.
If it hurts to take a deep breath, this could indicate a broken rib or breastbone. You could get...