“I am the first and I am the last.” This title applies to God here, and it appears in a similar form in Isaiah 48:12. See the commentary on Revelation 1:17.
“no God besides me.” We have capitalized “God” here, as do a large number of English versions, because that is the meaning of the text. God is saying there is no other being who is His equal, i.e., “God.” There is only one true God, Yahweh, the creator of the universe. Although some versions have “god” with a lower case “g,” and read, “there is no other god besides me,” that is not technically correct because there are lesser “gods” alongside the true God. The entire Old Testament is filled with admonitions for God’s people not to worship other gods, and 1 Corinthians 8:5 says there are many “gods.” However, we are to know the one true God, even as Jesus himself prayed: “that they know you, the only true God, and Jesus Christ whom you have sent” (John 17:3).