A toilet is designed to work on at least a 3" pipe but a 4" is generally the largest used; since the outlet of the toilet is generally in the 2-3" range, a 3" pipe won't present any obstructions.
With a 3" drain pipe, you want a toilet flange that fits on the outside of the pipe, not the inside which would make it too narrow (on a 4", you could install one on the inside). Since you aren't supposed to go from a bigger pipe to a smaller one, only the other way, you should maintain the size you have. If it's only 2.5" below, you may need to actually cut some off to be able to get a coupling in there and have enough room to then fully seat the toilet flange to the stub sticking out.
How far down does the pipe go before it makes a bend? Or, double-check, it's possible that you are seeing a hub, and not just a piece of pipe. If it's a hub, the ID will be 3.5", if it's a stub of pipe, it would have an ID of 3" (or 4"). The wall thickness on pvc is about 1/4" times 2, giving you the 3.5" ID of a hub. If it's a hub, then that makes life easier, as you can insert a stub with the flange on the end.
The toilet flange is designed to be installed on TOP of the FINISHED floor and anchored into the floor. If tiling, then you'd want to probably notch the tile for the screws so you don't have to drill through the tile later - this can be done, but it's much easier to notch it and then only have to drill into the concrete which is MUCH softer than the tile.