These titles are synonymous but applied in two different ways to God the Father and His Son, Jesus.
For Jesus the “first and the last” means that he is the ultimate in the category so described in Rev 1:17-18; 2:8:
“I’m the first and the last, who was dead but is now alive.”
So what is Jesus “the first and the last” of?
According to Heb. 12:2 Jesus is “the author and finisher of our faith.” And Paul describes Jesus as “the first fruit of a great harvest of all who have died.” (1Cor 15:20, NLT) This means that only in Christ can you hope to become “a new person,” i.e., raised back to life in a new “spiritual body” in the Kingdom age to come (2Cor 5:17; 1Cor 15).
For God the title “First and the Last” is connected with the phrase “the one Who is, Who was, Who is to come” (Rev 1:8). An obvious allusion to the Divine Name in Ex. 3:14 variously translated as “the eternal God,” “the Eternal One,” “God eternally lives.” This means that God is the only one Who by nature is eternal, i.e., He cannot die.
“Lord, haven’t you existed forever? You are my holy God. You will never die.” Habakkuk 1:12 NIRV
“God is the only one who never dies.” 1 Timothy 6:16a ERV
So just because the Father and His Son share titles doesn’t mean they share the same identity.