I also have a similar memory of reading a science fiction novel featuring a young male protagonist who hailed from a giant space station, who, at some point, climbed inside the body of a giant, transparent space whale.
I have definitively identified that story as Raft, by Stephen Baxter: 224 pages, published July 11, 1991. ISBN: 978-0246137067
I cannot be certain if this book is what the thread's author is looking for, but I am immensely gratified to have finally discovered the source of a long-lost memory of mine.
What if we exponentially reduced the scale of the galaxy so that the sun was only 50 yards across, extinguished its raging burn so that only a solid metal lump remained, and set a chain of a few hundred dwellings to orbit around the cold sphere that remained? Imagining as such, you would have the opening of Stephen Baxter’s 1991 Raft. By its conclusion, however, Raft reveals itself as a highly original mix of science and fantasy that continues playing with the scale of the universe while telling an uplifting yet sobering tale of personal and societal evolution.
The title of the book comes from the remodeled space craft that hangs above the mini-ringworld orbiting the dead star. Exactly like a raft in space, this large disc of metal is home to a few thousand that depend on the metals the miners extract below, just as the miners depend on supplies from the raft above, for survival. A prime opportunity for class discussion, Baxter takes advantage, contrasting the poor working class conditions of the miners against the more civilized and technically advanced version of life on the raft. Gravity increasing to 3, 4, and even 5 gees the closer one gets to the dead star’s metal center, work in the mines, like industrial work on earth, is not always a picnic, and compared to life on the raft, it’s hell. Suffice to say, relations between the two locations are not always on the best of terms and provide a good portion of plot tension.
Though the physics are not always clear, base plot is motivated by the slow death of the nebula beyond. Atmosphere breathable anywhere in the galaxy, the raft and orbital nevertheless depend on the nebula’s light for sustenance. Catalyzing the need for action while facing this threat is the book’s main character, Rees. A young man who starts as a miner, his moral choices take him to amazing places as the story progresses, the canopies of floating trees, the belly of a space whale, and to live amongst one of the more grisly societies in sci-fi, the Boneys. Part adventure and part bildungsroman, a large portion of the story deals with Rees’ development into a responsible person and awareness of the burden he bears in saving the small community drifting through the dying nebula.