Not to give anything away, but “in about five billion years, the sun will swell to its red giant phase, engulf the orbit of Mercury and perhaps Venus, and leave the Earth a charred, lifeless, magma-covered rock.” That’s how Katie Mack starts her story. It’s downhill from there. Many books have been written about our cosmic origins: the creation of the universe 13.8 billion years ago; the Big Bang and all that followed. The denouement, presumably tens of billions of years away, remains comparatively mysterious. How does it all end? For that matter, does it all end, or can we keep on in our merry way indefinitely? In “The End of Everything: (Astrophysically Speaking),” Mack, a theoretical cosmologist at North Carolina State University, attempts to answer what might seem the most remote of scientific questions.