This was the most controversial moment of the match.
Lucio plays a ball out to the wing for Cafu. Adriano clearly turns his back on the play and isn't involved. The referee rightly allows play to continue as the players on the wing are involved.
Controversy arises moments later when Adriano then becomes involved in another play near the area which originated from this run.
The referee and linesman see this as another play altogether and allow the subsequent goal. This is up to interpretation and could have gone either way. However, it's unfair to claim foul play as the referee was within the rules to simply adjudge the subsequent goal as a totally separate play.
Once in an offside position does not mean that a player will remain offside for the rest of the match.
Others may argue that the two plays were related and therefore the original offside should have been called.
In any event, the referee was well within his rights and the rules in opting for the former argument.