Bathtub diverters sit in the tub's faucet, where you must pull up on the post on the top of the spout to divert the water to the shower head. When the diverter becomes stuck, you must loosen it or you will have to replace the entire spout. The replacement spout needs to have a diverter in the same spot as the old spout and it must attach to the water pipe that same way as the old spout.
Spray penetrating lubricant into the spout opening so it hits the diverter piece. Spray the penetrating lubricant around the post on the top of the water spout and wait five minutes or more before trying the diverter again.
Remove the bathtub's spout to replace it and the diverter. Look over the underside of the spout with a flashlight, looking for a small screw that may hold the spout on the water pipe.
Remove the screw on the underside of the spout, if one is present, using an appropriately sized Allen wrench. Pull on the spout as you wiggle it left and right to remove the spout from the water pipe.
Clamp a pipe wrench to the old spout if you do not see a screw. Turn the entire spout counterclockwise with the wrench until the spout unthreads from the water pipe.
Slide the new spout onto the water pipe and tighten the screw on the spout's underside. If the water pipe has threads, clean them with a wire brush and wrap pipe tape clockwise around them. Thread the new spout onto the pipe by hand, wrap the spout with a thick towel and clamp the pipe wrench to the spout so you can turn it clockwise until the back of the spout touches the tub and shower surround.