Yes, the answer above is right. A pharmacist by the name of Charles Elmer Hires was the one responsible for the name of root beer. He was the first to have commercially sold a brand of root beer with high success in the market. Hires has chosen to abstain from drinks that contain any form of alcohol, person who does so is called a teetotaler back then, so he wanted to call it “root tea” initially, since the product was actually sassafras root tea. In order to market it to the Pennsylvania coal miners, he decides that calling his product “root beer” would sell better. He began bottling the now famous drink and by 1983, it was widely popular all over the US. Then non-alcoholic root beer soon appears on the market especially during the Prohibition era. They are called beer since it used to contain alcohol and root because it used to be made from root extract.