I do not understand the Rabbinic prohibition of not shaving during Chol HaMoed. Why did the Rabbis ban shaving on Chol HaMoed to prevent people from waiting until Chol HaMoed to shave? What about the people who correctly shaved erev yom tov? Why should they not be able to shave during Chol HaMoed for a mitzvah purpose such as Shabbat and the final day of yom tov? Doesn’t not shaving also look like we are publicly mourning on Chol HaMoed?
I have already answered a similar question on this site, so I have repeated here what I have already written with some additional sources and comments. The source for allowing one to shave on Chol Hamoe'd is Rabbenu Tam in the Tosafot to Moed Katan 13b as quoted by the Tur Orach Chaim 531. The logic of Rabbenu Tam is, that if the reason to not allow shaving is so that one should enter the Chag while unshaved, if he had shaved before the Chag then he should be allowed. The very same Tur who quotes Rabbenu Tam disagrees with him and says if that would be the case then the Talmud should have said so explicitly as it did in a case of one who has only one set of clothing who is allowed to wash his clothing during Chol Hamoe'd. Since the Talmud did not say so, he doesn’t see how it can be allowed. The Shulchan Aruch 531 rules that one is not allowed to shave on Chol Hamoe'd even if he had shaved before. If you are interested in more sources I suggest you see the Halachik journal Tchumin. In volume 2 there is an article by Rav Yitzchak Pecha, which leans towards allowing shaving on Chol Hamo'ed if one shaved before. However the conclusion of the author is that to begin with one should not shave, but if one did there are those to rely upon. In volume 3 in Tchumin there is a response by Rav Shalom Mashsash in which he explains all the reasons why it is wrong to shave and why there is no way to disagree with the ruling of the Shulchan Aruch. Rav Moshe Feinstein zt"l allowed shaving during Chol Hamo'ed if there is great necessity or in a case of extreme discomfort. Part of the reasoning being that in our time when people shave everyday it is not the same situation described in the aforementioned Tur Orach Chaim 531. (See אגרות משה ח"א קסג and see also שו"ת דבר חברון סי' תקמג of Rav Dov Lior shlit"a, the Rabbi of Kiryat Arba)