(a) It is narrated from Abu Ma'mar: I prayed behind a man in Makkah, and he gave the salam on both sides. I mentioned this to Sayyiduna Abdullah (may Allah be pleased with him), and he said: Where did he grasp this from? And al-Hakam said:
"The Messenger of Allah (peace and blessings be upon him) also used to do this."
(b) It is reported in Sahih Muslim through another chain, but in it, instead of 'anna 'aqalaha' (where did he grasp it from), it is 'anna 'aliqaha' (where did he pick it up from).
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الصلاة / 2971