When choosing to be self-employed in a foreign country, you must consider the deductions that you would normally have on your paystub as an employee. These are mainly pension contributions and insurance premiums. Being self-employed does not make them go away; in fact, they might get even more expensive. One of the pension contributions that American sole-proprietors have to make is in the form of the self-employment tax. For most people, including expatriates, it is 15.3% of net income. There might be a similar pension contribution in the country of your residence, and it might be unavoidable. If this is the case, self-employment in your country of residence might be a non-option.
A workaround to explore is to form a corporation and be an employee. In that situation there will be local payroll taxes for both the employee and the employer, again a double tax. Because of the employer portion of payroll taxes, forming a corportation just to avoid the U.S. SE tax might not be an excellent choice. It may depend on how high the local payroll taxes are. For example, here in Finland, the employer portion of the social security contribution is 19% and the employee portion is 5.7%, for a total of 24.7%. If an expatriate living in Finland were to be just an employee, and not an owner, then the contribution would only be 5.7%.
As a self-employed person, that individual would have to make both the Finnish YEL payment (an approximation of the U.S. self-employment tax) and the U.S. self-employment tax. The 23.7% YEL payment plus the U.S. SE tax of 15.3% total up to 39% of net income. If said expat were to form a corportation, the Finnish pension contribution would be 24.7% and the U.S. social security tax would be 0%. This might be a feasible option for retailers and manufacturers, but not personal service companies, whose income falls under the catagory of Subpart F, and must pay U.S. income taxes. Personal services include any activity performed in the fields of accounting, actuarial science, architecture, consulting, engineering, health (including veterinary services), law, and the performing arts.
Controlled foreign corporations (CFC's) are required to report the IRS. See article: US Taxpayers Must File IRS Form 5471 To Report their Ownership in Foreign Corporations. There is also the issue of the Foreign tax credit which might offset the disadvantage of having to pay the self-employment tax. However, the FTC is not allowed for pension and insurance payments because those are for a specific economic benefit.