Tooth has three layers. If underlying pulp has exposed in case of broken tooth,it is painful. and that can be treated with root canal treatment. However, dental x-ray is necessory for the confirmation. In case of carious tooth, you may feel pain. Please note that if your tooth has hit by any object. In such case of accident also pulp of tooth can get damaged followed by pain.