What is the earliest known appearance of a hero's greatgrandparent in any genre of folklore? By that I mean where the hero's greatgrandparent is alive and interacts with the hero.
When you said "great-grandparent" I instantly thought of Lamech, descendant of Cain. Unfortunately my memory was wrong — Lamech was Cain's great-great-great-grandson, not Cain's great-grandson.
It turns out that there is a Talmudic story that involves a fatal interaction between Lamech and his great-great-great-grandfather Cain. Wikipedia:
The Talmud and Midrash present an extensive legend, told, for example, by Rashi,11th century in which Lamech first loses his sight from age, and had to be led by Tubal-Cain, the seventh generation from Cain. Tubal-Cain saw in the distance something that he first took for an animal, but it was actually Cain (still alive, due to the extensive life span of the antediluvians) whom Lamech had accidentally killed with an arrow. When they discovered who it was, Lamech, in sorrow, clapped his hands together, which (for an unclear reason) kills Tubal-Cain. In consequence, Lamech's wives desert him. A similar legend is preserved in the pseudepigraphic Second Book of Adam and Eve,sixth century? Chapter XIII; in this version Tubal-Cain is not named, but is instead referred to as "the young shepherd." After Lamech claps his hands he strikes the young shepherd on the head. To ensure his death, he then smashed his head with a rock.
HEAR MY VOICE — For his wives separated from him because he had killed Cain and Tubal-Cain, his own son. Lamech was blind and Tubal-Cain used to lead him. The latter saw Cain and thought him to be an animal. He therefore told his father to draw the bow, and thus Lamech killed him. As soon as he learned that it was his forefather Cain, he smote his hands together, struck his son between them and so killed him too. His wives thereupon separated from him, and he endeavoured to appease them, saying שמען קולי “Hear my voice”— obey me and return to me: for the man I slew — was he slain by my wounding? i. e. did I wound him with premeditation, that the wound should be called by my name (i. e. attributed to me); and the child that I slew — was it slain by my blow? (i. e. by a blow directed intentionally by me?) [Rashi here inserts the word בתמיה which he uses frequently to direct that the preceding words should be read as a question.] Did I not act inadvertently and not with premeditation? This was not my wound, nor was this my blow!
Now, this is technically not an answer yet (the difference in generations is too great), and the story was probably made up in the 11th century A.D. so it's not very old; but I bet there's a similar Old Testament story waiting to be found here...
Oho! Notably, Enoch was the great-grandfather of Noah... and indeed the Book of Enochfirst century B.C.! features at least one conversation between these two figures, in Chapters 64 through 66-ish.
In those days Noah saw that the earth became inclined, and that destruction approached.
Then he lifted up his feet, and went to the ends of the earth, to the dwelling of his great-grandfather Enoch.
And Noah cried with a bitter voice, Hear me; hear me; hear me: three times. And he said, Tell me what is transacting upon the earth; for the earth labours, and is violently shaken. Surely I shall perish with it.
After this there was a great perturbation on earth, and a voice was heard from heaven. [Noah] fell down on [his] face, when [Noah's] great-grandfather Enoch came and stood by [him].
[Enoch] said to [Noah], Why have you cried out to me with a bitter cry and lamentation?