I have a 9V battery, but I only need to output 4.5V from it. How do I accomplish this?
No, not with that design. Buy an LM7805 voltage regulator (they are cheap). Add bypass capacitors as required. Add a 1N5822 diode on the output with a tiny minimum load. The final voltage will be close to 4.5 volts, but not exact.

To get 4.500 volts to within 1% or better you will need a more complex circuit.







simulate this circuit &ndash; Schematic created using CircuitLab