We use Lyapunov type functions to give new conditions under
which a homeomorphism of a compact metric space has the
shadowing property. These conditions are applied to establish the topological stability of some homeomorphisms with nonhyperbolic behavior.