The Oxford English Dictionary and others suggest that it comes from a translation in 1707, by J. Stevens, of Francisco de Quevedo (Spanish author):[2] "You would have me teach my Grandame to suck Eggs".
[3][4] A record from 1859 implies common usage by that time.
[5] Most likely the meaning of the idiom derives from the fact that before the advent of modern dentistry (and modern dental prostheses) many elderly people (grandparents) had very bad teeth, or no teeth, so that the simplest way for them to eat protein was to poke a pinhole in the shell of a raw egg and suck out the contents; therefore, a grandmother was usually already a practiced expert on sucking eggs and did not need anyone to show her how to do it.
[6] I remember my old schoolmaster, who was a prodigious great scholar, used often to say, Polly matete cry town is my daskalon.
The English of which, he told us, was, That a child may sometimes teach his grandmother to suck eggs.The use of the phrase suck-egg for 'a silly person' is dated back to 1609 by the OED.