I am thinking about setting up a offshore company
Offshore from where?
Do you live in a foreign country, or is the country you live in not foreign? Or is it only foreign to people who aren't in it?
I generally try to avoid countries which have a lot of foreigners in them. Like France, for example. You'd be amazed how many French people there are in France. I was in Mexico City a few years ago, and I told my wife, "My God, look around.... this is what happens if you don't keep Mexicans out of your country!"
But if, for example, you are in the US, and your idea of "tax planning" means setting up a shell corporation in a foreign country, running your income through that, and then figuring out some way to benefit in the US from those foreign funds without telling the IRS, then the best piece of advice I could give you is to make sure you have a toothbrush with you at all times. Because that's the sort of tax planning that can suddenly make it difficult for you to get back home to pick up your toothbrush.
For example, this is the last time in a long time that this guy was able to walk on a public street:
He went in, and didn't come out. I'm not sure if he had his toothbrush with him, but he definitely needed some extra blades and a tube of hair color, since when last seen he looked like this: