If there was a whole spaceship and not a single character, this could be a slightly jumbled recollection of Tau Zero by Poul Anderson. This is a classic, mostly remembered for its ending. The ship is experiencing time faster than observers on Earth due to time dilation: it is moving at relativistic speeds. Due to a malfunction, the ship becomes unable to slow down without also shutting down the mechanism that protects it from collisions with ambiant particles. The crew decides to accelerate even more in the hope of reaching a less dense region of space where they will be able to safely shut down the engine and repair it. They end up accelerating to exit the galaxy, then to exit the supercluster, and so on. After a few years have passed, the end of the universe catches up with them, but they survive a big crunch followed by a new big bang after which they are able to decelerate.
This is by no means the only book in which characters survive the end of the universe and into the next one. As Wayfaring Stranger suggests, the last volume of James Blish's Cities in Flight series (The Triumph of Time) also has this plot element. There, a whole planet survives, but not in a physical form: the minds of the “survivors” influence the shaping of the next universe.