The great Hadith master (hafidh), Imam Shams al-Din al-Dhahabi (Allah have mercy on him) states in his short but brilliant treatise al-Muqizah:
“Correcting of the intention by a student of sacred knowledge is essential. Thus, whosoever seeks the knowledge of Hadith (m, and other sciences of Islamic knowledge) to compete with others, to show-off, to achieve worldly gains or so that people praise him and his knowledge, then surely he has incurred loss. And if he seeks sacred knowledge for the sake of pleasing Allah Almighty and gaining rewards from Allah…and to benefit other people, then indeed he has triumphed. And if one’s intention is combined with the two, then the ruling (hukm) will be according to what is more dominant (ghalib).” (Dhahabi, al-Muqizah fi Ilm Mustalah al-Hadith with footnotes by Shaykh Abd al-Fattah Abu Ghuddah, P. 65)
The above statement of Imam Hafidh Dhahabi (Allah have mercy on him) pinpoints precisely as to what intention a student must have whilst seeking sacred knowledge. One must seek sacred and Islamic knowledge with the intention of pleasing Allah Most High and benefiting others, whilst seeking knowledge for pleasing the creation of Allah and for name and fame or with the intention of gaining worldly possessions is blameworthy. If one’s intention is a mixture of the two, in that he seeks knowledge for pleasing Allah Most High but at the same time there is an element of showing off, then one will be judged according to what is predominant of the two.
Also, Imam Dhahabi (Allah have mercy on him) further points out to the signs of having a sincere intention or otherwise, He mentions that the one who seeks knowledge for the sake of Allah Most High, then that knowledge creates in him humility, humbleness and the fear of Allah. And the one who seeks knowledge for worldly gains, he becomes proud with his knowledge, thus argues and quarrels with other Muslims. (See: al-Muqizah, p. 65)
Thus, your responsibility is to correct your intention at the outset and keep examining and rectifying your intention whilst studying. If you do that, you will have fulfilled your responsibility, Insha Allah.
As for saying that sacred knowledge will create pride in you thus one should not study, this is totally incorrect and baseless. Seeking sacred knowledge is a fundamental responsibility of every Muslim male and female and should not be discarded with the fear of having pride. If one was to do that, then there is fear in everything that one does in ones life, thus one will not be able to live. This is the ploy of Shaytan, in that he wants to prevent you from studying.
Also, don’t let the name-calling affect you in your studies. Don’t worry or bother too much about it. Take it in from one ear and let it out from the other. This may be difficult but remember that, this is the Sunnah of Allah Most High, in that he does not (normally) give a high rank and status except with a struggle. Think of all the Prophets of Allah, what they had to go through in order to preach and invite people to Allah Most High. Our beloved Messenger of Allah (Allah bless him & give him peace) also had name-calling, such as: a magician, insane, etc.
Thus, you are in the footsteps of the Prophets and this is a sign of acceptance, Insha Allah. Be firm and carry on with your studies. If you are severely affected by the people around you and it is impossible for you to study, then you may even want to move to another place or have a new circle of friends or study at some other place. Abstain from disclosing to them about your studying rather keep it to yourself. May Allah Most High help and assist you in your endeavours and bless us all with the light of sacred knowledge, Ameen.
And Allah knows best