a) If you change a user's ID from email@example.com to firstname.lastname@example.org or
b) If you change a user's name from email@example.com to user@(O365_Custom_Domain_)Contoso.com, subsequently logging into firstname.lastname@example.org:
in both cases, will all mail, mail folders, and ODFB files and folders remain intact, to be seen and accessed as they were, after you start logging in using the new user ID, or is there anything you have to do to migrate the mail and onedrive objects to the newly created user ID?
Everything stays there and can readily be accessed. You are only changing the way the user will login (the credentials), all his mail, files, permissions and access stay the same. You might have to re-login to some apps, and ODFB in partticular might need to be reconfigured to recognize the changed URL corresponding to the new UPN.