How could a probe detect and map voids? Are there techniques for this?
Ground-penetrating radar?
Radar, either GPR (Ground-Penetrating Radar) or SIR (Subsurface Interface Radar) would seem the obvious solution. However, the shortcomings of those techniques (as pointed out in @FraserOfSmeg's answer) may mean that they are of limited use for finding deeper caves. A technique similar to CONSERT might be the solution. However, at the moment CONSERT doesn't have good enough resolution to accurately map caves, just give a good indication of where to look.
For really deep mapping of voids we might turn to seismic or sonic based techniques such as seismic tomography, reflection seismology, or direct sonic mapping. Several small “Philea-class” probes could be landed to listen to Phobos. They could either listen for natural seismic activity, or an orbiter could bombard Phobos with impactors, rather like Deep Impact.
There's a good article on void detection and mapping by a company called EnviroScan that outlines most of the techniques used on Earth:
Large volume voids such as significant washouts, mine workings,
tunnels, and karst-related cavities are excellent targets for
microgravity surveys. The “missing” mass of the void creates a
measurable disturbance in the earth’s gravitational field, with the
magnitude of the disturbance directly proportional to the volume of
the void. This relationship has allowed Enviroscan to use
microgravity surveys to assist engineers in the effective design and
accurate cost estimation of grouting programs. Other examples of
Enviroscan’s application of microgravity are mapping of undocumented
mine workings, location of abandoned or clandestine tunnels, and
delineation of areas of unsupported floor slab. Dramatic Microgravity
Anomaly Over a Cave System Beneath a Factory Since gravity surveys are
immune to many common sources of electronic or acoustic noise that can
impede many geophysical techniques, they are particularly suited to
highly developed or industrial sites.
Smaller shallow voids can be detected using ground penetrating radar
(GPR) or subsurface interface radar (SIR). Deeper voids are sometimes
best detected and measured using seismic reflection. Deep,
water-filled cavities (e.g. caves or tunnels below the below the water
table) are particularly good targets for seismic shear wave imaging
since water (or any fluid) cannot transmit shear waves - causing
water-filled voids to appear as characteristic “blank spots” or
shadows on a shear wave record.
Where boreholes are available, Enviroscan can perform crosshole
seismic or electrical tomography. Beneath water, sub-bottom sonar, as
well as gravity and sometimes radar can be used to detect voids such
as tunnels or bridge pier scour features.
Would the benefits of a pre-existing cave make it worthwhile to
convert it into a habitat, or is that just more work than building
something on the surface?
Much harder to answer. But we can speculate on a few points;
The seismic instability, depending on severity, could render the direct conversion of a cave impossible, but that doesn't mean the cave couldn't still be useful. NORAD is constructed on giant springs to survive the shock of a nuclear explosion, and a similar technique could be applied to a habitat in a Phobian cave to help it survive Phobos' quakes.
This would help reduce the risk of seismic activity rupturing the habitat, but unless the seismic nature of Phobos becomes very well understood it would probably still be considered too dangerous.
If seismic activity isn't an issue the advantages to converting a cave are the same as anywhere else; cheap habitable space and protection from radiation. Depending on how deep the cave is it could provide ample shielding from solar radiation.