
(a) Take a Gaussian surface lying inside the metal, enclosing the cavity. The field in the metal is zero, so the flux through it is zero and the charge enclosed must be zero. Hence the cavity surface carries −q.
The conductor is uncharged overall, so the outer surface carries +q.
(b) The charge −q on the cavity wall is non-uniform (denser near +q). Together with +q it produces zero field everywhere in the metal and outside the cavity, so the outer surface "feels" nothing of what is inside.
The outer +q therefore spreads uniformly over the outer spherical surface, as it would on an isolated charged sphere. Moving +q inside the cavity only rearranges the −q on the cavity wall; the outer charge and the field outside the conductor do not change.