In the tashahud we recite peace be upon you o Muhammed and Allah's blessings and mercy. Is this not praying to muhammad saws as we are directly praising him in the tashahud? Can you explain this please.
The Tashahud in Arabic according to the two schools (the Hanafi and the Hanbali) and its recitation which is attributed to Abdullah ibn Masud:
التَّحِيَّاتُ لِلّٰهِ وَالصَّلَوَاتُ وَالطَّيِّبَاتُ، اَلسَّلَامُ عَلَيْكَ أَيُّهَا النَّبِيُّ وَرَحْمَةُ اللهِ وَبَرَكَاتُهُ، اَلسَّلَامُ عَلَيْنَا وَ عَلٰى عِبَادِ اللهِ الصَّالِحِيْنَ، أَشْهَدُ أَنْ لَا إِلٰهَ إِلَّا اللهُ، وَأَشْهَدُ أَنَّ مُحَمَّدًا عَبْدُهُ وَ رَسُوْلُهُ
"Salutations to God and prayers and good deeds. Peace be upon you, O Prophet, and the mercy of God and his blessings. Peace be on us and on the righteous servants of God. I bear witness that there is no god but Allah, and I bear witness that Muhammad is His servant and His messenger."
I have bolded what you are asking about in your question regarding the Tashahud.
As you can see, the peace we are asking Allah of, is what would be upon (which is equal to on in English) Muhammad (SAW), not to for example.
Be upon somebody (formal) meaning according to Cambridge Dictionary:
to be something that someone will experience or have to deal with soon.
In the Tashahud, it is clear what is the something (peace) and who is the someone (Muhammad (SAW)).