Let us assume that the conductor and cavity are asymmetric random shapes with $q$ placed at any general location in the cavity. This charge q, will induce a charge -q on the cavity surface. The leftover charge after -q is drawn is +q and that distributes itself over the conductor exterior surface.
Force on the charge, $F=q/vec(E)$ is to be made zero. So Electric field at the location of the charge must be zero, assuming that it's a general point, we need the field to be zero at all points of the cavity. Now, what is producing this field?, When calculating forces, the field due to the othercharges is only important, so we can assume q to be removed entirely and calculate field due to -q and +q. On page 101 ehich is two pages behind the problem, Griffiths clearly states that the third field due to +q is separately zero than the sum of q and -q in the conductor. So we neglect +q in this calculation, this is understopd by the fact that conductors have infinite permittivity leading to symmetrical (zero) field on a gaussian surface in the conductor and as the integral due to it is zero as the surface does not enclose it, and as such distance in conductors for field is of no consequence as it does not decrease with distance, a symmetrical field will give zero integral that is the field due to +q is always zero. This is a logical and not mathematical proof.
The field is now only due to -q. We have already assumed the cavity as asymmetrical. Taking a gauss integral ( surface integral of electric field and dot product with perpendicular) is equal to the charge enclosed (zero) divided by permittivity. Now for the integral to be zero there are three possibilities, that the $/vec(E)$ is zero at all points of the surface (i) or it is perpendicular to the surface (ii) or it is equally positive as it is negative on the surface (iii). As we are free to assume any shape of the surface for gauss integral irrespective of cavity (assuming no limitation due ease of calculation) we can simply take a spherical shape that would make the curl of E non zero fo case (ii), which rules out (ii). Field can only be zero at all points for all gaussian surfaces for a symmetrical surface, specifically a sphere. Thus (iii) is the only possibilty and as proven by the second uniquemess theorem, if there is a field and charge distribution related to each other, you can be sure that it is a totally one to one relation for all space considered (not for localized areas, as is the case for method of images).