If your floorboards are in good condition, then you may be able to overboard these with a suitable tile backer board (see below.)
If this is the case, ensure there are no boards missing (or rotten) and that they are all securely screwed down to the joists below, taking care to avoid screwing into any cables or pipework underneath.
Plane off any high points where the boards have twisted.
If you’ve had to take up a large proportion of the existing floor to….
….then it might be worth biting the bullet and replacing the whole floor with plywood sheets.
This approach allows you to replace the existing floor with a new one with excellent rigidity that will provide you with a surface onto which you can directly apply tiles or apply a thin tile backer board on top for a professional approach.
This method, although more work, will allow you to inspect the joists and carry out remedial work if required, and it will also make running the pipework a lot easier if a bit more treacherous:
After you have removed the existing floorboards or chipboard, you can then lay a new plywood floor directly onto the top of the joists after all 1st fix work has been done.
Please see here for information relating to the order of bathroom installation work.