Foresight actually has two completely separate effects.
The first nullifies the immunities of Ghost-type pokemon, letting them be hit by Normal and Fighting-type moves.
The second effect is the nullification of evade modifiers (via Double Team and Minimize) on the targeted pokemon.
The application of Foresight is unaffected by the evade modifiers of the target, but it is affected by the accuracy modifiers of the user.
The effects of Foresight are “attached” only to the targeted pokemon, despite flavor text that appears in the game. No move or item can remove the effects of Foresight. The only way to end the effects of Foresight is for the targeted pokemon to switch out normally or faint. If the targeted pokemon switches out via Baton Pass, the effect will be carried over to the pokemon that is brought in.
Switching performed by the pokemon which used Foresight will not end the effects of Foresight.
Foresight is affected by Brightpowder when the opposing pokémon is equipped with it.