Zaphod Beeblebrox IV is Zaphod Beeblebrox's (the former President of the Galaxy) deceased great-grandfather.
Due to an accident with the aforementioned time machine and a contraceptive, Zaphod Beeblebrox is Zaphod Beeblebrox I (or the Nothingth, accoding to great-grandad), his father Zaphod Beeblebrox II, his grandfather Zaphod Beeblebrox III, and his great-grandfather Zaphod Beeblebrox IV.
In the radio series, Ford, Arthur and Zaphod hold a séance (instigated by Zaphod) in order to try and get help from Zaphod's great-grandfather to get them out of their current situation of being under attack from Vogons. Zaphod Beeblebrox IV seemed to dislike and distrust the living, and mentioned his disappointment in Zaphod. He looked down on his profession of being President of the Galaxy, and he said that his great-grandson's friends are 'disreputable'.
He was rather ill-tempered, and held his great-grandson in contempt for being so irresponsible. He admonished Zaphod for forgetting to put flowers on his grave and for not writing to his great-grandmother, or being aware that she was also dead. It was he who explained Zaphod's original plans for finding Zarniwoop and the 'man running the universe', as he knew that there were 'a lot of people wanting to have a word with him'. He also seemed to be able to slow down time to some degree, but only so that he could tell them a story. He was somewhat forgetful, but at other times sharp-minded, saying that his being dead had given him clearer insight into some things, a 'wonderfully uncluttered perspective'.
The only reason he helped Zaphod was because he couldn't bear the thought of him and his modern friends slouching around up there with him.
In the second book
Much like in the radio series, he helped Zaphod (who he called "Zaphod the Nothingth"), Ford, and Arthur, along with Trillian, and Marvin, to escape the Vogons by teleporting them to safety using his dead-person-powers after they conduct a séance to contact him.
It was shown in The Restaurant at the End of the Universe that he also had two heads which could be a feature passed on (thanks to an accident with a time machine and contraceptive) by Zaphod Beeblebrox himself.
He also gave Arthur a parting gift of tea ('the most delicious he [Arthur] had ever tasted') in a silver teapot after he heard that the Heart of Gold's circuits were occupied because of Arthur's efforts to teach the Nutri-Matic Drink Synthesizer to make tea.