You seem to be suffering from temporo Mandibular joint dysfunction secondary to dental problems. This pain can get referred to the ear. You may need to have soft diet, do hot compresses and take painkillers for few days
Next Steps
Consult nearby ENT specialist or maxillofacial surgeon for confirmation of diagnosis and appropriate treatment if required