Convert positive square wave to positive-negative
Use an op-amp, powered from +/-15 V rails to both amplify and level shift the 0 to 5V square wave: -



The circuit above is called an op-amp summer (or adder or mixer) in that two  analogue values are mathematically added. If V1 is the input waveform centred at 2.5 volts, the action of applying - 2.5 volts to V2 will result in the output, Vout being level shifted to make a square wave symettrical about 0V.

Choosing Rf appropriately will ensure the square wave amplitude is 24 volts p-p. Use a fast op-amp to preserve the speeds of the edges of the sq wave.

One more thing, the circuit above inverts the square wave so if duty cycle is important, this will appear inverted too.