The Swiss authorities online
In most countries, foreigners need to have a permit in order to work. This is usually issued when you receive an employment contract.
Unless you are employed by a Swiss company, under your new employment contract you will be subject to the laws in force in the country where you are living. The FDFA provides information on foreign employment contracts.
If you leave Switzerland, you will have to pay tax in the country in which you work. However, you may still have to pay some tax in Switzerland if you own property or work there from time to time. Switzerland has concluded double-taxation agreements with many countries so that you do not have to pay the same taxes in two different places.