With the little information that you provide, I'll hazard a wild guess on what might be appropriate. The rate at which the output has to switch is just fast enough that it precludes the use of a relay, so a semiconductor switch powered by the battery itself is best. You also need an oscillating circuit that provides the 15 to 20 times-per-second control to the switch. The oscillator is probably easiest using the old favorite, the 555 timer IC, configured as an astable multivibrator (an oscillator that keeps going). The on/off switch can be done quite simply by an appropriately biased PNP transistor, like a 2N3906 or virtually any PNP transistor.
Start by looking up the data sheet for the 555 timer (
https://www.fairchildsemi.com/ds/NE/NE555.pdf). The data sheet will have example circuit schematics, one of which is an astable multivibrator. Copy that, and power it from the 9V battery. The data sheet will give you an idea of what parts are needed to get 20 times per second switching. Wire the output of the 555 through a resistor (value anywhere from 1000 ohms to 10K ohms, whatever is handy) to the base of the 2N3906 transistor. Connect the emitter of the 2N3906 to the 9V battery supply and wire the collector through another 1000 ohm resistor to the negative terminal of the 9V battery. This latter resistor's wires are your output terminals.
In fact, you would probably satisfy the basic criteria using the 555 IC alone, without the additional 2N3906 transistor if it is acceptable for the output voltage to be only higher than 7.3 volts rather than exactly 9 volts. If this is the case, then just take the output from the 555 directly as it should be switching between 0 volts and about 7.3 volts (approximate, as this depends on what kind of meter or load is placed on the output) when it is operating. The addition of the 2N3906 helps pull the output voltage up to within about 0.2 volts of the battery voltage, or about 8.8 volts or higher depending on the battery condition.
One serious difficulty that you may face is that when you hook the circuit up and get it going, you won't know if it is working or not unless you have an oscilloscope to look at its output.
But you are not likely to have such a thing available. When a voltage pulses up to 9 volts at 20 times a second, you won't be able to read those pulses on a voltmeter, since the voltmeter will tend to average the voltage to a single number, which is ambiguous. You might be able to attach an LED (light emitting diode) to the output through a 330 ohm resistor and see if the LED is turning on and off, but honestly, at 20 times a second it may just appear to be constantly on. Your eye can't really distinguish that speed. I'm not sure what to suggest. One other way might be to couple the output voltage through a capacitor (10 microfarards or higher would be good) to the input of a hifi (audio) amplifier (using the AUX or CD input) and use your ear to see if you can hear a very raspy or buzzy low frequency sound on the speaker. It should be very loud and obvious if the thing is working at all and might sound a bit like a buzzy hum. You can distinguish this sound from the usual AC hum that you might hear due to the 60 Hz 120V in your house by changing the switching speed of the 555 (by, for example, changing the critical resistor value that affects the frequency of the 555) and noting that the buzz in the speaker changes tone.