One who does, and perseveres in doing. In public schools, it means a little boy who waits upon a bigger one. Probably a contracted form of factor, factotum; Latin, fac-ere, to do.
“Even the mendacious Mr. Fag assures us, though he never scruples to tell a lie at his master's command, yet it hurts his conscience to be found out.” —Sir Walter Scott.
Source: Dictionary of Phrase and Fable, E. Cobham Brewer, 1894
More on Fag from Infoplease: