The shape of the Universe is a subject of investigation within physical cosmology.
Cosmologists and astronomers describe the geometry of the Universe which includes both local geometry and global geometry.
The shape of the universe can be determined by measuring the average density of matter within it, assuming that all matter is evenly distributed, rather than the distortions caused by 'dense' objects such as galaxies.
This assumption is justified by the observations that, while the universe is "weakly" inhomogeneous and anisotropic (see the large-scale structure of the cosmos), it is on average homogeneous and isotropic.
Considerations of the geometry of the universe can be split into two parts; the local geometry relates to the observable universe, while the global geometry relates to the universe as a whole - including that which we can't measure.