If you do not wish to continue in business activities as a foreign person in Germany, you are obliged to abolish your sole trade at the relevant local office and to cancel your registration in the insurance company or your residence status. However, until the moment the business activities are terminated, you should do German bookkeeping, and at the end of the accounting period you should also submit a tax return and pay an income tax if necessary.