1. Do the factories on a planet contribute to the planet or to your civ as a whole? If its just for the planet then should you just build one or two factories for a planet that is not for making ships?
Factories provide production only for the planet on which they are built. If you are not going to be building ships, you should build however many you think you will need to upgrade at a reasonable rate. given enough asteroid mining bases, you might not even need one. Don't forget that you can always build over them later.
2. If you build (ie not buy) a ship, does it cost you credits?
Not directly, no. Your treasury will not decrease from building a ship or building. It does cost credits from your economy, but that just effect your profit's bottom line, not the treasury directly.
3. How do market centres(etc) work? Do they provide money per centre or as a percentage?
Market Centers improve your income from whatever sources the planet has by the percentage listed in their properties. They stack, so if you build 5 of them, you'll get a lot more money than if you build 1. The bonuses are always applied to the base, so two markets with a 15% bonus equal a 30% bonus to the base income of your planet.