There may be a hardware problem behind this symptom, in some instances it could involve some circuits on the logic board; but there could be other causes, too.
A general dogpile of results came in when I used google search of symptoms: ibook g4 fan running black screenhttps://www.google.com/#q=ibook+g4+fan+running+black+screen to include questions/replies from elsewhere online. To include a few from Apple support discussion communities.
This Apple communities discussion probably covers most angles of the symptoms...
https://discussions.apple.com/thread/3998776
There are a few authorized repair facilities that offer a fix for solder joints that may be a cause of this problem; in that the hot/cold flexing of solder joints on the logic board had been suggested as a cause of failure in certain instances. In the case of this kind of repair, once opened up and corrected, any additional upgrade or replacement of worn parts is nominal over the cost of the parts.
Hopefully this helps somewhat.
Good luck & happy computing! 🙂