Batteries, better safe than the possible alternatives.
I do not have any objection to connecting to the wall as long as it is IEC60601 rated.
>- getting an amplifier with a range of 5Hz to 30kHz
Sadly, that will not produce a good square wave. The best amplifier will have a range up to about 800,000 Hz in order to generate the harmonics in a square wave.
If all you need is an audio frequency sine wave then it will be fine.