"Also, are there nice hotels that you would recommend that are convenient to trains?"
I haven't stayed close to the station there in the past. Nor do I know what your hotel requirements are.
Click on the "open map" box near the top of this page to find hotels near the station - "Freiburg (Breisgau) Hbf" on the map, next to a little blue train symbol. You can read what hundreds of people have to say about those hotels by clicking on the hotels.
Freiburg is a city of 230,000 people - no small village - so I imagine there is some small level of crime, but it seems safe enough for me.
That said, If you're doing outings by train into the Black Forest, you might want to pick another town - a smaller one. The best train destinations involve the Black Forest Railway line, a scenic route that connects several attractive villages. It's doable but a bit of a trek from Freiburg; the other thing is you can't make these trips for free if you stay in Freiburg. For free, you ask? Yes. the KONUS card, which offers free train travel throughout the Black Forest, is available for free from innkeepers in smaller towns but not the big ones like Freiburg. Stay in a smaller, attractive old-world town like Gengenbach, and this card is yours for the asking. A trip to the other BF Railway villages is convenient from there, and you can be in Freiburg on a day trip in about 1 hour.
Gengenbach
Black Forest Railway info
Black Forest Railway map
KONUS details
Accommodations on the Black Forest Tourism website include options you will never find on the big booking websites.
If you really need to be near Freiburg for some reason, you can stay in nearby Kirchzarten and get the KONUS card. It's a short train ride into Freiburg from there.