First of all we congratulate you on accepting Islam and grant you glad tidings of goodness and blessings, and we see that your insistence to adhere to your faith is a sign of your success, God willing. Your placing Allah’s rights over the rights of His slaves is certainly the best attitude a believer can have.
As for the issue of the beard, then it is compulsory according to the texts of the honoured Sunnah (prophetic teachings). Ibn ‘Omar (may Allah be pleased with him) said that the Messenger of Allah (may the peace and blessings of Allah be upon him) said: “Be different from the mushrikeen (polytheists): let your beards grow and trim your moustaches.” (al-Bukhari and Muslim)
See the answer to question 1189 for further details.
Leaving the beard to grow is following the way of the Messenger of Allah (may the peace and blessings of Allah be upon him). And Allah says (what means): “There has certainly been for you in the Messenger of Allah an excellent pattern for anyone whose hope is in Allah and the Last Day and [who] remembers Allah often.” (33:21)
As for shaving it due to school regulations and the requests of the family, then there are steps you need to take before giving in to such requests:
1. Try to have the school waive the rule for you and allow you to grow your beard. If there is a higher committee or an owner of the school, address them as well to make an exception for you.
2. If this is not successful, then look for a congressman in your area or a personality who has weight so they may intercede on your behalf with the school administration.
3. If that is not possible, then look into lodging a complaint against the school for violating your freedom of rights.
4. If all the above is not successful, then search for an alternate school whose rules will allow you to grow your beard.
If any of what has been mentioned above is possible, then do it so as to free yourself of blame. It is not permissible to do that which is unlawful while there is a possibility to avoid it.
If all your efforts to maintain your beard fail, or you do not have the time to attempt all the steps and the only two choices before you are expulsion or shaving, then Insha Allah (God willing), there is no blame on you to follow the rules under pressure but only for the time being until you complete your studies after which time you return to adhering to the guidance of the Prophet (peace and blessings of Allah be upon him) and his sunnah.
If it is possible to trim the beard rather than shave it, that would be better. But if they do not allow trimming and insist on you shaving, then we hope that you will be excused before Allah as you made every effort to avoid it but were unsuccessful. Allah does not burden a soul with more than it can bear. Allah says (what means): “So fear Allah as much as you are able” (64:16). And He says (what means): “Allah does not charge a soul except [with that within] its capacity.” (2:286). As soon as the school year ends, return to growing the beard.
We ask Allah to guide you to His pleasure and to make easy for you every good and avert evil from you.
And Allah knows best.