On the recovery of a discontinuous wavespeed in wave scattering in a nonhomogeneous medium