Before wearing ihram it is a recommended sunnah to clip one’s fingernails, trim the moustache, shave off the hair from under the armpits, shave the pubic hair, make an ablution or preferably take a complete bath, and in the case of men, to comb their beard and hair. So, it is not a must to shave hair or cut nails before ihram. However, this is among the recommended sunnah of ihram.
It should be also clear that one should put off ihram at 10th Dhul Hijjah after throwing the pebbles or performing tawaf Al-Ifadah. This is in case of Hajj ifrad. He has to shave or shorten his hair. As for cutting nails, this is a matter of choice.
In case of Hajj tamattu`, one should put off ihram after `Umrah. This means that after performing `Umrah he has to put off ihram and shave or shorten his hair before wearing ihram again on 8th of Dhul Hijjah. On 10th of Dhul Hijjah, he has to put off ihram as we elaborated above after throwing the pebbles or performing tawaf Al-Ifadah.
Allah Almighty knows best.