1- Because he wanted to show us mercy. Not because he has any needs, but just to show us mercy. And to achieve the highest mercy we worship Him.
2- By praying to Him and confessing His greatness, we connect ourselves to the source of all goodness in the universe. If we don’t, we will disconnect ourselves and be doomed. Allah is merciful so he wants us to succeed, not to be doomed.