Allah prays to himself, because he can do everything.
With that logic, Allah can contradict himself in the Qu’ran, because he can do everything he wants and Muslims must not question him but only submit to his will.
Now, this idea of absolute divine freedom in Allah is actually self-contradicting, and I’ll show you why that is. (We’ll get back to prayer in a moment)
Allah is called all-merciful in the Qu’ran (1:2, 15:49, 16:7).
But how do we know he isn’t lying? He can do everything, so he could lie.
Or, let’s say he isn’t lying. Let’s say Allah is merciful and forgiving. How do you know he’ll forgive you your sins? He can do everything, so even if you’re the holiest person alive, you can still go to hell. Allah can turn his back on your good deeds and just let you go to hell. Because though he’s compassionate, he dosen’t have to be compassionate.
So Allah can contradict himself, and the Qu’ran can very well be a lie Allah told Mohammed. That alone is sufficent to debunk Islam, which would explain why Muslims are called to submit and not to question: if they had knowledge of the truth, they would suddenly see the errors of Islam, and so, they would no longer be Muslims.
But let’s get back to Allah praying to himself. I want to show how this is contradicted by Islam itself, not to spite Islam but to show the logic used by Islam.
In Islam, prayer has two purposes: to communicate with Allah and to restrain the believer from doing evil. Allah, being Allah, wouldn’t need prayer to communicate with himself. So he can’t pray to communicate with himself. He might pray in order to restrain himself from doing evil, but than he is said to be merciful, and of course, yet again he is said to be able to do everything, so perhaps he dose need prayer to stop himself from doing evil - I honestly don’t know about this point.
However, there are two other possibilities I can see for Allah praying, the former of which would make sense and the latter of which is (supposedly) an ancient belief about Allah, dating back to pre-Islam. The former reason for Allah praying is this: He wishes to set a good example for believers. Now, this would be fine if it wasn’t self-contradicting, since Allah swears by lesser beings but demands everyone to swear by him alone, so that possibility is out the window. The latter reason for Allah praying is this: He is praising his followers before the angels. This would, on face value, make sense, until you realize that prayer is different for Allah and for man: for Allah, prayer means praise and, for man, prayer means prayer. So what we have here is a single word - prayer (salah) - having two different meanings. It would be like taking the word “cow” and saying it means a female cattle for man and cow milk for the cows. It dosen’t work.
Interestingly enough, some Muslims say prayer of Allah and prayer of man is connected because as Allah praises his believers, he gives them blessings, that is, he answers their prayers, and this giving of blessing is the connection of prayer between Allah and man. In other words, prayer is communication with Allah because Allah answers the person’s prayers, and prayer is praise of Allah’s followers because the person dose good (prays). This seems good, until you realize that man is forcing Allah to give him blessing - or, at best, Allah is forcing the man to do good so that he could give him his blessings. And if it is man who is forcing Allah to act, than I wonder who is greater: Allah or a man? Allah wouldn’t be bestowing blessings on man, since prayer requires Allah-man, but must force them on man. It is even’t a give-and-take scenario, it is forcing.
However you see it, Allah praying to himself makes no sense.
I could go on, but I won’t.