When I was a little boy, maybe 6 years old, 1964, space flight was new and exciting. I remember imagining being an astronaut and tooling around the universe in my rocket ship. I thought about what would happen when I reached the edge of the universe. Would there be a brick wall or what? Well that introduced the thought of what's on the other side of the wall? So I discarded that idea. Then I remembered my dad telling me that if I started walking and continued to walk in a straight line, that I would eventually come back to where I started. So I figured the same thing would happen in my imaginary spaceship. The universe must somehow curve back in on itself. Never acquired the math or science education to pursue that line of inquiry, but 60 years later I still find it an interesting idea.
Back in the 1960s, the possibility that the universe is
closed was more plausible than it is today.
Closed means what you say: that if you jumped in your spaceship and travelled continuously in one direction, you'd eventually come back to where you started. The other possibility is an
open universe, in which you could travel forever in one direction and never return.
Theoretical cosmological models allow for closed universes and open universes and "flat" universes, with "flat" being a sort of borderline version between the two, although a flat universe looks more "open" than "closed".
In the 1960s, it was thought that whether the universe was open or closed would be determined mainly by the average density of mass and energy in the universe. With enough mass, the universe would have to be closed; not enough mass and the universe is open. The mass density also determines the long-term fate of the universe. Closed universes are destined to slow their expansion over time, and then start collapsing again, eventually ending in a "big crunch". Open universes (and flat ones), on the other hand, expand forever.
Observations of the mass density in our universe actually show that out universe is so close to being "flat" than we can't be sure if it is open or closed (or actually flat).
However, recently a huge spanner has been thrown into the works. We discovered that our universe is not just expanding, but that the expansion is
accelerating. In mass-only models of the universe, such behaviour is impossible. However, Einstein's equations from back in the 1910s allow for the possibility of a
cosmological constant in the relevant gravitational equations. For most of the 20th century, it was thought that the cosmological constant of our universe was probably zero; this is what Einstein himself guessed. But a non-zero cosmological constant would produce the sort of accelerating expansion of the universe than we have observed.
The question then becomes: what
causes a non-zero cosmological constant? The current answer is: we don't know. The place-holder name that is given to the cause, these days, is "dark energy". To match observations, dark energy must make up about 75% of our universe, and we don't know what it is yet. However, there don't seem to be many other viable candidate theories that can explain the apparent accelerating expansion of our universe.
There's work still to be done in cosmology, clearly.