You can take your dog or cat with you when traveling. Train tickets in Germany can be purchased for them at about half the regular fare. Rules for air transport of animals vary from airline to airline, but, in response to customer demand, they are usually friendly about it. The airline should be notified when you book the flight if you plan to take a pet. It's almost always required that the animal be in a kennel that is sturdy, properly ventilated and large enough so that the animal may freely stand, turn around and lie down.
Prescribed kennels are available at pet stores and from most airlines.
Remember to check with the airline when in doubt. The kennel usually goes in a pressurized cargo bay, though some airlines allow passengers to carry their pets in the cabin if the kennel can fit under a seat. There are pet travel services that can be useful, especially if the animal won't be accompanied by the owner. They also can advise on pitfalls to shipment such as a quarantine period at the destination. For animals other than dogs or cats, check with the German authorities or the airlines.