If a Pokemon becomes confused, does the confusion go away if it switches?
Yes, It does go away when It switches. Note, that Confusion can be Baton Passed.
This works like the ability Natural Cure and Shed Skin/Healer(I think), that gets rid of your Pokemon's status problems upon switching out. As Halcyonic Falcon has said, It works similar with all Secondary status effects.
Yes it does. The same goes for infatuation and all secondary status aliments.
Yes. It is like natural cure that only works for confusion. Even in the anime confusion goes away after the pokemon comes back into it's pokeball; in the battle frontier episode that ash battles lady annabelle, she confuses corophish & he brings it back into the pokeball after batteling espeon & he sends it strait back in & corophish is not confused any more.
Hope thus helps:)