There are small number of general legal requirements for setting up a business in Germany. For example, you must be an adult - that is, at least 18 years old. Another requirement is that you have never been banned from practicing the profession you intend to set up a business in. Such a prohibition can be imposed by courts after serious criminal offences.
Before starting up your own business, you must register your planned activity. You do this either at the trade office (Gewerbeamt) or the tax office (Finanzamt) - depending on whether you intend to work on a self-employed basis (gewerblich) or as a freelancer (freiberuflich). For some professions you will need to prove that you do not have a criminal record. EU citizens resident in Germany can usually apply for a "European Certificate of Good Conduct" for this purpose at their local Residents' Registration Office. If you come from another country, you will need to obtain comparable proof from the competent authorities there.
Additional information on the formalities you need to go through as you set up your business is available here.
Last but not least, you should ask yourself if you are ready to be your own boss. To better assess your personal requirements, you can do a helpful online test here (in German only). If you have any doubts, it may also be worth seeking advice from a start-up expert.
Recognition in Germany
BMWi Startup guide for Germany