In Germany you can buy prepaid SIM cards in most supermarkets, electronic stores and small phone shops. There is a big number of providers operating in 3 networks. Data packages are quite expensive and you have to register with a german adress to be able to buy a SIM card. And be aware that for some offers (with automated top-ups) even a german bank account is needed. That's why it is best to ask some local friend for help or visit a small phone shop where usually better support is offered.
The 3 german network operators are: Telekom, Vodafone and ePlus/O2.
Used frequency bands are European standard and every modern smartphone bought in Europe should be usable with german SIM cards.
2G: 900/1800 MHz
3G: 2100 MHz
4G: 800/1800/2600 MHz