The subfloor in a home is usually installed before the walls and is generally something you don't mess with.
But there are different types of underlayments for different floors. For vinyl you can use thin luan plywood, and I understand there are even better materials, if you can find them. This only needs to be about 1/4" thick, and it is frequently stapled down.
For ceramic tile, you need a tile backerboard, usually 1/2" thick. I prefer Hardibacker because it is easier to work with than the cement boards like Durock, and it is more waterproof. You set this in latex modified thinset and screw it down every 8" each direction.
For much more guidance in setting tile, read that topic on my website at www.bobf.info.