The Torah has already informed us (in the previous Pasuk, 42:7) that Yosef recognized his brothers. Why does it repeat it here?
Rashi #1: The Torah is pointing out here the difference between him and them. Yosef recognized the brothers because when he left them they already had full beards, but they did not recognize him because his beard had not yet fully grown. 1
Rashi #2: The Torah is pointing out here that when his brothers fell into his hands, he had mercy on them and treated them as brothers; whereas when he fell into their hands, they did not treat him as a brother. 2
Ramban: After they told him that they came from Kena'an, any remaining doubts were dispelled and he knew for sure that they were his brothers.
Ramban (citing the Ibn Ezra and Seforno): At first, he merely recognized them as a group, and then individually.
Oznayim la'Torah #1: According to the Midrash - that he read his brothers' names from the papers that they handed over when they entered Egypt at different entry points, he initially recognized them collectively, but now, he recognized each one individually.
Oznayim la'Torah (based on Gitin 23a): Initially, he recognized them by their looks, and after he spoke to them, he recognized them also by their voices.
Ohr ha'Chayim: Normally, when one person recognizes another, the latter senses this and recognizes the former; here, his brothers did not.
Ha'amek Davar: Until now, he feared that they will recognize him, so he did not say that they are spies. Now after they answered his harsh words, he was sure that they did not recognize him.
Gur Aryeh: We might have thought that the brothers happened not to recognize Yosef at first, but they might recognize him at any moment - if so, how could he risk accusing them as spies (42:9)? Rashi explains that our Pasuk is coming to emphasize that they could not possibly recognize him - for only now did he have a beard.
Gur Aryeh: Why does Rashi bring this additional answer (based on Midrash)? The verse could have sufficed with 'Yosef recognized them.' It emphasizes "recognized his brothers," to show that he acted as a brother to them - despite that they had not done so to him.
Why did Yosef's brothers not recognize him?
Rashi and Rashbam #1: Refer to 42:8:1:1.
Ramban, Ohr ha'Chayim: Because, unlike Yosef, who anticipated their arrival, it would never have occurred to them that the brother they had sold as a slave to the Yishme'elim was the ruler of Egypt.
Seforno: Refer to 42:7:2:1.
Rashbam #2: Because they now saw him as a royal figure, wearing royal robes. 1
Rashbam #3, They did not recognize him by his voice, because he did not speak to them directly, only via an interpreter.
Malbim: It is because he spoke to them harshly. Also refer to 42:7:2:3.
And a turban that partially covered his face (Ramban).