Dynamical Behaviors of Nonlinear Wave Equation in Inhomogeneous Media