The best answer we have currently comes from general relativity. GR describes gravitational forces by geometry - specifically, it retains Newton's 1st postulate (that bodies move in straight lines unless acted on by an external force), but instead of treating gravity as a force, it treats it as a deformation of space caused by energy* (and "straight line" becomes "geodesic" - the shortest distance between two points on a curved space, like the paths airplanes take on long flights).
So what is space in GR? It's a dynamical thing (i.e. it can change with time, in response to changing configurations of matter) described by an object called the metric tensor. So it's not fixed or rigid. It's determined by the value the metric takes in the region near you, just as the electric field is the value the electric field takes in the region near you. Physically, one measures it by studying the motion of any collection of objects, much as one studies the electric field by studying the motion of charged particles.
If one tries to go beyond GR and include quantum mechanics it's clear that this description will fail at some level. Probably what replaces it is a quantum version in which the metric we measure on large distances (via gravity) is an average, while the true metric is fluctuating randomly about that average. One of the peculiar facts about quantum gravity is that those fluctuations get stronger and larger if you measure them on shorter distances - which means below some distance (the Planck length), it is probable that notions like "length", "space", and "time" lost their meaning - the average isn't a good description when fluctuations are too large.
That's all speculation, though - no one knows for sure.
*In GR one does NOT need matter or energy to have space, as seems to be a common misconception on these forums. One needs matter or energy to have a curved space.