[Physics FAQ] - [Copyright]
Updated 1995 by MM.
Original by Matt McIrvin.
Purely in terms of general relativity, there is no problem here. The gravity doesn't have to get out of the black hole. General relativity is a local theory, which means that the field at a certain point in spacetime is determined entirely by things going on at places that can communicate with it at speeds less than or equal to c. If a star collapses into a black hole, the gravitational field outside the black hole may be calculated entirely from the properties of the star and its external gravitational field before it becomes a black hole. Just as the light registering late stages in my fall takes longer and longer to get out to you at a large distance, the gravitational consequences of events late in the star's collapse take longer and longer to ripple out to the world at large. In this sense the black hole is a kind of "frozen star": the gravitational field is a fossil field. The same is true of the electromagnetic field that a black hole may possess.
Often this question is phrased in terms of gravitons, the hypothetical quanta of spacetime distortion. If things like gravity correspond to the exchange of "particles" like gravitons, how can they get out of the event horizon to do their job?
Gravitons don't exist in general relativity, because GR is not a quantum theory. They might be part of a theory of quantum gravity when it is completely developed, but even then it might not be best to describe gravitational attraction as produced by virtual gravitons. See the physics FAQ on virtual particles for a discussion of this.
Nevertheless, the question in this form is still worth asking, because black holes can have static electric fields, and we know that these may be described in terms of virtual photons. So how do the virtual photons get out of the event horizon? Well, for one thing, they can come from the charged matter prior to collapse, just like classical effects. In addition, however, virtual particles aren't confined to the interiors of light cones: they can go faster than light! Consequently the event horizon, which is really just a surface that moves at the speed of light, presents no barrier.
I couldn't use these virtual photons after falling into the hole to communicate with you outside the hole; nor could I escape from the hole by somehow turning myself into virtual particles. The reason is that virtual particles don't carry any information outside the light cone. See the physics FAQ on virtual particles for details.