The full quote from "The Shepherd Boy" in the book "Household Tales" by the Brothers Grimm is:
The King said, "The third question is, how many seconds of time are there in eternity." Then said the shepherd boy, "In Lower Pomerania is the Diamond Mountain, which is two miles and a half high, two miles and a half wide, and two miles and a half in depth; every hundred years a little bird comes and sharpens its beak on it, and when the whole mountain is worn away by this, then the first second of eternity will be over."
The King said, "The third question is, how many seconds of time are there in eternity." Then said the shepherd boy, "In Lower Pomerania is the Diamond Mountain, which is two miles and a half high, two miles and a half wide, and two miles and a half in depth; every hundred years a little bird comes and sharpens its beak on it, and when the whole mountain is worn away by this, then the first second of eternity will be over."
Writing in Doctor Who Magazine #495, Steven Moffat confirmed that the portrait of Clara was painted by the Doctor himself.
The skull the Doctor finds is based on Peter Capaldi's own bone structure - the effects team reverse-engineered the shape of his skull from a lifecast that was taken to create the "ghost Doctor" prosthetics for Under the Lake (2015)/Before the Flood (2015).
When the Doctor first sees himself on the monitor in the castle, there is writing on the stone wall next to the window that is briefly visible in the shot. The lettering is black with red capitals, and it is the opening voice over of this episode ("As you come into this world...") with a few lines missing.
While imagining talking to Clara, the Doctor breaks the fourth wall, looks at the camera and says "I'm nothing without an audience".