How do I replace this cast iron toilet flange?
Removing the old pipe
First you want to make sure the section of pipe that will remain, is properly supported (you don't want it falling). Then you'll want to install some temporary supports, to catch the portion of the pipe that you'll be removing.
Use a chain cutter, hammer and cold chisel, or grinder to break the pipe a few inches before the hub on the next pipe. This short YouTube clip shows how easy it is to cut cast iron with a chain cutter.

Next you'll want to use a hammer and cold chisel to break up the remaining bit of pipe, being careful not to damage the hub.  Once you get enough of the pipe broken up, you'll notice a lead ring inside the hub.  Using a prybar (or other similar tool), try to deform the ring enough that it can be removed (again, being careful not to damage the hub). carefully drilling holes in the lead ring can make it easier to remove it, just be careful not to drill too deep.
Once you have the old pipe and lead gasket removed, clean the hub up a bit and remove any bits of debris.
Install the new pipe
To install the new pipe, you'll need a 4x4 or 4x3 rubber compression donut.

Slip the donut gasket over the end of your new PVC pipe, and fit it into the cast iron hub (A bit of gasket lubricant will make fitting the gasket easier).  Work the gasket into the hub, until it is firmly seated in the hub.

Broken hub
If you were a bit overzealous and you ended up breaking the hub, you'll just have to use a coupling to attach the pipes.  Cut the cast iron pipe after the hub, then use a coupling to connect the pipe.  Make sure both pipes are well supported, since these couplings are not designed to hold weight.