Limits
The theoretical maximum amount of rock that can be over a natural cave is 3,000 m (per https://en.wikipedia.org/wiki/Cave which gives no obvious cite). This matches well to the crushing pressure of rocks, though. Beyond that, even the hardest stone will be crushed down by the rock above it, to fill the void.
No caves have been found this deep. The deepest oil wells are deeper, though, up to 9.5 km. The deepest hole ever drilled was about 12 km, and the temperature at the bottom was above boiling point, so would not have supported life.
The deepest mine, and the deepest a human has ever gone, is 3.9 km.
On a planet with lower gravity, or in a species which lives underwater (so the pressure between rock and water is equalized and the caves don't crush so easily), far deeper caves would be possible.
So it seems there are answers already aplenty to establish what's below, and their position relative to it:
- how fast their rocky universe rotates about an axis (Faucalt pendulum).
- what angle they are to the axis (pendulum rotation = universe rotation rate x sine of latitude)
- how far they are from the gravitational core (curvature of level tunnels, divergence of parallel vertical tunnels, etc)
Finding the distance to the surface is arguably a trickier proposition, but there have been many ways proposed for indirect measurements.
- The pull of the mass above you. But inside a sphere, there is no net "pull of the mass above you", so gravitational measurements of the rock above you are not going to help.
- Echo-sounding/seismographic surveys. On most planetary-sized objects, this would definitely work no matter how deep they are, at least with seismic/nuclear-level waves. Nukes are unlikely to be popular as scientific measurement tools for civilizations living underground, so only seismic effects would give a big enough wave to measure as it reflected around the world.
- Rock type boundaries/Metamorphic transitions. This one is interesting, it requires understanding of rock formation and subduction, but could work as way to double-check other results.
- Water table. Requires them to have a water table, mind, and I'm not sure this is a reliable estimate of depth from surface.
- Geothermal gradients.
- Air pressure, to get atmospheric height.
- Digging upwards.
- Liquid pressure measurement in a chamber. This would work, but is unnecessary: an important measure when mining is the pressure of the rock, and for this you can measure the deformation of a drilled hole using common mining equipment. An underground civilization would likely have improved over our own approaches for this.
https://geoinfo.nmt.edu/publications/monographs/circulars/downloads/69/Circular-69.pdf explains the basics (at least as they were in 1963: I imagine we use much more sensitive electronic measures now)
Can we make a planet which makes this maximally difficult?
Really, the most interesting questions (from a world-building perspective) are whether it's possible to make this really hard for the inhabitants; and how deep they could be living before pressure from the rock made living impossible.
We could have a rogue planet, cast off from its sun (perhaps by a near-miss with another planet, perhaps by the ancestors of its current inhabitants).
They have dug deeper and deeper as the core cooled. The atmosphere and oceans have been ripped away, If they did dig up to the surface, they'd be dealing with the extreme cold (~3 Kelvin) and hard vacuum of deep space. So they avoid digging upwards. They might have legends of sealing their caves from any fissures that did open, but they come from countless generations back: they are too deep now, 10s of km below the light planet's surface.
The planet is either not spinning significantly, or is tumbling slowly and chaotically enough that pendulums don't help (tangential question: is it possible to make a tumble chaotic enough that you could not factorize it to pitch/roll/yaw with pendulums?)
Losses of knowledge over deep time (plagues, wars, natural disasters) mean that they don't have nuclear weaponry or power, nor can they perform terraforming-scale efforts.
For whatever reason, their records of core temperature measurements go back at most just a few generations, so they can't use the speed of cooling of the core to calculate the insulating thickness of rock above.
(tangential question: How cool would it have to get before there were no longer quakes, and how deep would people have to have dug? Could heat from radioactive material help reduce this? Even the moon has moon-quakes)
Being a rogue planet, asteroid impacts would be too rare to use as stand-ins for seismic effects.
Assuming they don't live in water, their max depth is determined by gravitational strength acting on the rocks above them. On a light planet, like the moon, that could be tens of km.
Could even this deliberately-limited civilization figure it out, then?
Well, divergence of vertical shafts would still give their distance from the center of planetary mass. So they would know their rock universe had a center of mass.
They would be able to measure pressure gradients in the rock, and know the mass of rock, so if they assume similar rock all the way above them, can calculate the depth of rock above them. If they assume a spherical planet, that gives them a planetary radius.
Reflection and absorption of seismic waves would tell them the varying densities of rock on the planet, letting them make the calculations about gravity more precise.
But they can compare that to the gravitational constant to determine that a spherical mass of rock to generate those readings is consistent with the gravitational strength they measure.
And they can use what they know of rock's crush-strength and gravity to calculate the potato radius ( https://www.technologyreview.com/2010/04/12/27697/potato-radius-to-define-dwarf-planets/ ), to prove that the planet is spherical.