Some specific tips:
Many Germans (especially the younger ones) are quite proficient in English and are eager to use their English knowledge, so it can sometimes be hard for people coming to Germany trying to learn German (friends that came from abroad told me so themselves), as almost everyone will try to speak with you in English. So try to keep your fellow students from trying to speak English with you (as it probably will happen).
Some people trying to learn the language have good experience with a so called language tandem partner, a native German speaker that wants to improve their knowledge of your language. The way this works is that you regularly meet and when it's their turn to help you, you will only converse in German, and they will tell you what you can improve on and point out mistakes. The next time you swap and converse only in your language and you help them. You can find a tandem partner buy putting up a note on the universities' black board (digital or IRL).
Try to find a specialized dictionary catered to academics / mathematicians, as the German you will have learned in a regular course will probably lack specific vocabulary that you will need during your studies. Some universities will also offer German courses for international students (that might be more focused on "academic" vocabulary).