You don't replace anything based on online opinions of pictures of a discolored subfloor. (actually it isn't the subfloor at all, it's underlayment, the subfloor is underneath) Slight leaks at toilet flanges, due to wax seal failure, are common. This is NOT a disastrous situation. I have literally gotten the call from a homeowner AFTER the toilet fell through the floor, and my crew removed the entire bathroom floor and replaced floor joists. OTOH, I have changed many wax rings where the subfloor looked like that, and there was zero real damage, other than light, cosmetic water staining.
The first issue is that you have an existing underlayment that needs to be removed. You are not looking at a plywood subfloor, but a layer of 1/4" Luan plywood undlerlay used to prep the floor for the vinyl you removed. This crap is not only unsuitable for use under tile, but it is typically just lightly nailed or stapled to the plywood, or OSB, subfloor. You need to tear it ALL out before you can evaluate any damage underneath. Now on to damage evaluation.
Step one: Look for extreme rot. A scratch awl, or other sharp point is ideal, a small straight blade screwdriver will do. Now poke around the flange and see if there is rot in the plywood. This can vary from easily poking straight through, to scratching the fuzzy discolored surface of the plywood. If you can't push a small screwdriver more than 1/8" or so, into the plywood, it's fine. Hit the black area with straight bleach, rinse it off and let it dry. If you have a small area of rot, you may want to think about an epoxy patch, as replacing the subfloor in this area isn't pleasant or easy.
Step two: Evaluate the toilet flange. I literally do not see a single screw in the flange attaching the flange to the floor. If the plywood is still in good shape, pre-drill and install #12 x 1-1/4" phillips head wood screws in every one of these small holes. A lot of leaking toilet flanges are a result of slobs and morons who do a half assed job of securing the toilet flange. You wouldn't believe how many end up with three or four little drywall screws that rot and work loose quickly.
If the plywood is in fact rotted, you have a bigger issue. You need to cut back to the center of adjoining joists and replace the plywood with a new section, typically installing blocking to support the edges of the patch. The flange needs to be removed and replaced. Believe it or not, you can actually demolish the flange in this case, and save the fitting it's glued into. It is a labor intensive project that involves hammering, chiseling, cutting with just a hacksaw blade, cursing, prying with screwdrivers, and maybe some blood, but it makes the job a lot easier if you have a finished ceiling below.
At this point, demoing the luan is just matter of getting under it with a flat bar and yanking it up. You can cut through it with a utility knife, it takes a while, but it's doable. After that, and evaluating the subfloor, post some more pics.
Finally, take a look at using the Ditra system for the tile subfloor, it is superior in every way, and a lot easier to install than cement board. Cement board is a product from the bowels of hell. Everything about it sucks. If you still want to go with a board product, use Hardie board tile backer. Not the wonder product that Ditra is, but exponentially better than cement board for simple floor work.