Inside / Outside is a science fiction novel by American writer Philip José Farmer. Originally released in 1964, the novel explores the question of what happens before souls inhabit human bodies, and how they are created.
Jack Cull (a pun on the word "jackal") finds himself in a bizarre location called "Hell". A huge sphere with a sun in the center, Hell's population consists of deceased humans and demons; the humans have the same mind and body as when they died, there is no disease or famine, and deaths are reversed within hours. Earthquakes are frequent occurrences. Humans have taken control of Hell, and they have replaced the traditional inscription (as imagined by Dante), "Abandon all hope..." (written in Italian) with a new one: "Do not abandon hope" (written in Hebrew).
Cull goes to his workplace, and hears that the mysterious "X", an analogue of Jesus Christ, has been killed by an unruly mob. Along with Phyllis and Fyodor, based on Fyodor Dostoyevsky, Jack investigates his death. Travelling into a sewer, they find out that "Hell" is in fact a massive spacecraft, controlled by hyper-moral, ultra-powerful alien beings with the means of capturing many if not most of the souls they come upon, incorporating them in immortal bodies (provided they are fed regularly). However, the capturing of souls is an imperfect process, and many souls are lost to the void. Although the bodies are more or less immortal, there comes a time when the aliens destroy them when they feel the souls have progressed to an acceptable level. Even then, not all of the bodies are destroyed, and some continue on with the spaceship as it travels about the galaxy.