Since the influence of friend of man is very deep, Islamic teachings have given an important status to the friendship. In Holy Qur’an it is stated that most of the companions of the Fire will say, in the Hell, that
So it is very important to know how your friend is.
In this regard, there is a very nice hadith in which Imam Baqir (A.S) said:
My father Ali Ibn al- Hussein (A.S), once, advised me: ‘O son, do not associate, talk, or accompany five classes of people.’ ‘Who are they, father?’ asked me, and he (A.S) answered: ‘Beware of associating with the liar, for he is as same as a mirage: he shows you the near as remote, and shows you the remote as near. Beware of associating with the sinful, for he will disappoint you for a single bite or even something less valuable. Beware of associating with the stingy, for he will let you down when you are in urgent need of his property. Beware of associating the foolish, for he harms you when he intends to do you favor. Beware of associating with the disregardful of his relatives, for I found him cursed in the Book of Allah. 
1. Al-Furqan 28&29.
2. Al-Kāfi; Vol 3, page 641