If I'm put on amoxicillin due to tooth infection, could it get rid of your infection and toothache?

Temporary solution. Amoxicillin is an antibiotic, not a pain killer. It can temporarily shrink down an infection, and therefore reduce your pain for a short time. Unless you have the source of the infection treated with a root canal or by extracting the tooth, it will come back as soon as you are off the antibiotic. You must have dentist finish treating your tooth.
Temporarily. Until the tooth in question is restored or extracted, the infection will resume once you stop the antibiotics. Since you can't take the antibiotics forever, the sooner you see a local dentist to examine you the better off you will be.
Unlikely see dentist. The only way to cure a dental abscess is with dental treatment. We have now entered an era where some bacterial species are resistant to the full range of antibiotics presently available. Antibiotics are used along with other dental treatment only when needed. See your dentist for evaluation, x-rays and treatment. .
No. Antibiotic may control the infection and limit spread, but only as long as you are taking the medication. The only way to get rid of the infection is to eliminate the infected tooth material. That means either root canal/crown or extraction/implant/crown. Please have the infection treated as soon as possible.