Sayyiduna Uthman Ghani (may Allah be pleased with him) says: A man came to the Prophet (peace and blessings be upon him) and said: "O Messenger of Allah! I was praying, and I did not know whether I had prayed an even number of rak'ahs or an odd number." The Prophet (peace and blessings be upon him) said: "Beware of Shaytan toying with you in your prayer. Whoever among you is praying and does not know whether he has prayed an even or an odd number of rak'ahs should prostrate twice, for these two will complete his prayer."
Ahmad recorded it through Yazid bin Abi Kabshah from Sayyiduna Uthman Ghani (may Allah be pleased with him), and Yazid did not hear from Sayyiduna Uthman (may Allah be pleased with him). Ahmad's son Abdullah narrated it from Yazid bin Abi Kabshah, from Marwan, from Sayyiduna Uthman (may Allah be pleased with him), and narrated something similar. The narrators of both routes are thiqat (trustworthy).
Hadith Referenceمجمع الزوائد ومنبع الفوائد / كتاب الصلاة / 2907