I have extreme tooth pain with an ear infection what should I do?

Root canal. Lower molars that have pulp disease routinely refer the pain to the ear. An endodontist will diagnose and treat. Extraction is an option but saving teeth is better if possible.
See a dentist. You may think you have an ear infection but because of the nerve tract it may very well be all from your teeth. I would strongly recommend you see a dentist soon. Likely you will need a root canal or extraction to resolve the issue completely. Most cases will not get better but worse until you finally do something so call soon, best of luck.
2 separate issues. And should be treated separately. 1. See your GP physician for ear infection evaluation and management. 2. See your DDS for toothache examination and treatment.
DDS and MD\ENT. See a dentist to evaluate your tooth as to what is wrong and what needs to be done to make it better. How do you know you have an ear infection? Is it that it merely hurts and you assume so, or you were told that my a physician? The tooth pain and the ear pain may be related or it may be coincidental. Only a physician after examination can tell you for sure that you have an ear infection.