There is a Hadith in the Sahih of Muslim which says that Muhammad (sws) said that if somebody intends to offer an animal on Eid al-Azha he should not cut his nails and should not trim/cut his hair (head, underarms and private parts) from 1st to the 10th of Zilhijjah i.e. till Qurbani. Kindly guide
This is a custom to show solidarity with the pilgrims. It is not obligatory in nature though and is recommended for those who want to sacrifice an animal on Eid.
When a person does not cut his hair or nails, he through this practice, devotes himself to God for these ten days. He does not embellish himself showing that he has cut himself off from the pleasures of life for these ten days very much like the pilgrims.