Repotting produces a quantity of old compost, and throwing it away feels wasteful. Whether to reuse it depends on what state it is in and what you plan to use it for.
What is wrong with it
Three things, usually all at once. The nutrients are depleted, since the plant has taken them up over two or three years. The structure has collapsed, as the organic material has decomposed into finer particles that pack more tightly. And it may carry accumulated salts, a drifted pH, and whatever pests or pathogens the previous plant had.
That last point is the one that matters most: reusing compost from a plant that died of root rot, or that had fungus gnats or vine weevils, passes the problem directly to the next plant.
When not to reuse it
If the plant it came from was diseased, had root rot, or had a soil-dwelling pest. If it smells sour. If it is from a plant that died and you do not know why. In all of those cases it goes on the garden heap or in the green bin, not into another pot.
When it is fine
Compost from a healthy plant that was simply potted on, particularly if it is only a year or two old, can reasonably be reused – not on its own, but refreshed.
Mix it roughly half and half with fresh compost, add perlite or bark to restore the air space that has been lost, and treat the result as a mix with no residual fertiliser, feeding from the outset once the plant is growing.
Better uses for it
Old compost is genuinely useful outdoors. It works as a soil improver dug into borders, as a mulch, as the bulk filler in the bottom of very large outdoor containers, and as an addition to a garden compost heap.
Those uses ask nothing of its structure or nutrient content, which is where its remaining value lies.
A note on economics
Compost is among the cheapest inputs in houseplant keeping. Set against the value of a mature plant and the effort of repotting it, the saving from reusing old compost is small and the risk is not.
For anything you care about, use fresh. For potting up rooted cuttings you have dozens of, a refreshed half-and-half mix is perfectly reasonable.
Sterilising it, and whether that is worth doing
Old compost can be heat-treated to kill pests and pathogens – in an oven, or by solarising in a sealed bag in the sun. Both work and both are more effort than the material is worth for a domestic collection, and the smell of compost baking in a kitchen oven is memorable for the wrong reasons.
Sterilising also does nothing about the two other problems: the structure has still collapsed and the nutrients are still gone.
What to do with it instead
If you have a garden, it goes on a border or a heap and does genuine good. If you do not, most councils accept it in garden waste collections.
It is also useful for weighting the bottom of large decorative planters where the inner pot sits on top, or for filling the base of an outdoor container that would otherwise need an impractical quantity of fresh compost.