There is a verse in Quran saying God created humans to worship Him.
But, God does not need our worship. Does it mean worship is a middle goal to humans so that they be trained for a higher goal?
What is the final goal of creating humans and nature and all things?
The verse is:
وَمَا خَلَقْتُ الْجِنَّ وَالْإِنسَ إِلَّا لِيَعْبُدُونِ
And I did not create the jinn and mankind except to worship Me.
Zariyat 56 (51/56)