  We give necessary and sufficient conditions for a semi-Riemannian manifold of
arbitrary signature to be locally isometrically immersed into certain warped
products. Then, we describe a way to use the structure equations of such
immersions to construct foliations of marginally trapped surfaces in a
four-dimensional Lorentzian spacetimes. We point out that, sometimes, Gauss and
Codazzi equations are not sufficient to ensure the existence of a local
isometric immersion of a semi-Riemannian manifold as a hypersurface of another
manifold. We finally give two low-dimensional examples to illustrate our
results.
