It is obligatory upon the student of knowledge to be on guard against suspecting others of bad things, like his saying, “This one didn’t give charity except in order to be seen by others,” [and] “[That] student didn’t ask this question except to show off, so that it gets known that he is a student with understanding.”
The hypocrites, when someone would come from among the believers with charity, if it were a lot, would say, “Show off,” and when it was a little, would say, “Truly, Allāh is not in need of the of this one’s charity.” This is as Allāh said about them:
الَّذِينَ يَلْمِزُونَ الْمُطَّوِّعِينَ مِنَ الْمُؤْمِنِينَ فِي الصَّدَقَاتِ وَالَّذِينَ لا يَجِدُونَ إِلَّا جُهْدَهُمْ فَيَسْخَرُونَ مِنْهُمْ سَخِرَ اللَّهُ مِنْهُمْ وَلَهُمْ عَذَابٌ أَلِيمٌ
Those who backbite and look out for faults in those who give [a lot of] charity voluntarily from among the believers and [in] those that do not find other than [a small amount] in their ability [to give, which they then give]—they make fun of them, [so] Allāh made a mockery of them, and they will have an agonizing punishment. (Al-Tawbah 79)
So beware of suspecting one whose apparent condition is righteousness. And there is no difference between your having suspicions about your teacher or your colleague, for indeed what is obligatory is having good thoughts about the one whose apparent condition is righteousness. As for one whose apparent condition is not righteousness, then there is no objection to your having suspicions about him.
But nevertheless, it is upon you to ascertain the truth of the matter until nothing remains of this misgiving you have, since some people might have suspicions about a particular person based upon false impressions that have no [basis in] reality.
So what is obligatory when you suspect a person, whether [he be] from among the students of knowledge or other than them, what is obligatory is that you look to see if there are any clear indicators that [would] allow you to have suspicions [about him] without any problem.
As for if it were misgivings along [that you had], then it is not permissible for you to have suspicions about a Muslim whose apparent condition is righteousness. Allāh says:
يَا أَيُّهَا الَّذِينَ آمَنُوا اجْتَنِبُوا كَثِيراً مِنَ الظَّنِّ
O you have believed, keep away from much that is suspicion. (Al-Ḥujurāt 12)
He did not say, “All suspicion,” since some suspicions have a [valid] source and reason permitting them.
“Indeed some suspicions are sins,” and not all suspicions. So the suspicion in which there is oppression to others, there is no doubt that it is a sin; that is also the case with a suspicion that has no basis. As for when there is a basis for it, then there is no problem with your having a suspicion in accordance with [existing] indicators and proofs.