The setting is Jesus in the wilderness, being tempted by the devil (vs. 1) and the second temptation is for Jesus to hurl himself down from a pinnacle in the temple “in the holy city” (vss. 5 & 6).
The devil is, again, trying to get Jesus disbelieving the very words of God in heaven to him at his baptism 40 days earlier: ‘This is my beloved Son, in whom I am well pleased.’ (Mat. 3:17)
Satan casts doubt on this by saying to Jesus, ‘If thou be the Son of God…’
The question asked here arises because Jesus resists that temptation by answering,
“It is written again, Thou shalt not tempt the Lord thy God” (vs. 7,
According to the words in Mt 4:1, it is Jesus who is being tempted.
Then Jesus was led up by the Spirit into the wilderness to be tempted
by the devil. – Mt 4:1
The temptations that were devised for Jesus all had the purpose of turning him away from his mission, which was to serve the Father and to do His will. Reference Mt 20:28 :
The Son of Man did not come to be served, but to serve, and to give
his life as a ransom for many.” – Mt 20:28
In Matthew 4: 5-7, Satan tempted Jesus to prove his identity, to show that he is indeed the Son of God.
“If You are the Son of God, throw Yourself down.” – Mt 4:6
In actuality, the trap that was set was for Jesus to do the devil’s will and not the will of the Father. It would have served Satan’s purposes if Jesus had done what he suggested, regardless of how the Father responded or what might happen after.
If we accept that it is Jesus who is being tempted, then there remains the riddle of Jesus’ answer. To whom do his words apply? To God the Father or to himself? If he is the one being tempted, then the logical conclusion is that the words apply to Jesus. Central to Satan’s temptation is the question of Jesus' identity. By applying the quote from Deut 6:16 to himself, Jesus affirms his identity as the Son of God by claiming for himself the full honor and glory of what such a relationship implies.
The word in v7 is actually "test" [EKPEIRASEIS]. The word "tempt" has picked up modern overtones which make it an unhelpful translation nowadays.
The point of the answer is that if Jesus allowed himself to make the experiment suggested by Satan, then he, Jesus, would be testing his Father, which is what they have been commanded not to do.
Jesus is quoting the command from Deuteronomy ch6 v16; "You shall not put the Lord your God to the test, as you tested him as Massah" (RSV). Deuteronomy, in turn, is referring to the episode in Exodus ch17 vv1-7. This is when the people were finding fault with Moses and demanded that he help them, because there was a shortage of water. As a result, Moses "called the name of the place Massah and Meribah, because they put the Lord to the proof by saying 'Is the Lord among us or not?'" (v7).
The devil's proposal is that Jesus should throw himself down from the pinnacle of the temple, to see if God would send angels to help him, for the purpose of discovering whether or not "you are the Son of God". But this would have been precisely what the Israelites were doing at Massah. It would have been "putting the Lord to the proof".
That is why Jesus reminds him that we have all been commanded not to do anything of the kind.
Satan is tempting Jesus. If, however, Jesus had succumbed to the temptation, he (Jesus) would be "tempting" God. This is why Jesus answers as he does. Jesus is using the scripture to support his decision not to "tempt" God by doing as Satan desires.
The word "tempt" here in the Bible, both in the original Hebrew which Jesus quoted, and in the Greek in which this account is recorded, carries a meaning of prove, test or try in addition to "tempt." It is not limited to the meaning of "tempt" current in today's English. Indeed, the Bible says God cannot be tempted with evil (see James 1:13).
Ye shall not tempt (H5254: תְנַסּ֔וּ/ṯə·nas·sū) the LORD your God, as
ye tempted (H5254) him in Massah. (Deuteronomy 6:16, KJV)
Jesus said unto him, It is written again, Thou shalt not tempt (G1598:
ἐκπειράσεις/ekpeiraseis) the Lord thy God. (Matthew 4:7, KJV; cf. Luke 4:12)
Let no man say when he is tempted, I am tempted of God: for God cannot
be tempted (G551: ἀπείραστός/apeirastos) with evil, neither tempteth
he any man: (James 1:13, KJV)
NOTE: The verb "tempt" in James 1:13 is from the same root word in all four occurrences, but due to grammatical differences in usage involving a prefix, the other three usages have a different Strong's number (G3985)--owing to a different placement in the alphabetical order. This is the same root word used in Matthew and in Luke as well.
We are commanded not to even try to tempt God--who could not be tempted with evil anyway. Jesus did not wish to sin against this precept, and quoted it to Satan as a means of escaping the temptation that Satan was giving to Jesus.
Jesus, not God, was being tempted--and he quoted scripture that supported his refusal to tempt God, not that God could have been tempted, but it is wrong to attempt it.
In the plain text of Matthew 4:7, it was Jesus who being tested. But wait, there is a much deeper implication of this account. A question is, forty days ago, a voice from heaven just said "This is my Son, whom I love; with him I am well pleased" (Matt 3:17 NIV), then why would the spirit led Jesus into the wilderness to be tested (Matt 4:1)? And what does the test of Jesus is going to tell us?
Recalled the moment of Eve being tested. The devil succeeded for he hit the desire of Eve, as we read;
6 When the woman saw that the fruit of the tree was good for food and pleasing to the eye, and also desirable for gaining wisdom, she took some and ate it.
Human has desire, which allow devil to find our weakness. Jesus had to go through the same tested to prove himself a human but capable to overcome the power of the devil, by the power of the word of God. In all three tests, Jesus replied Satan with a quote from the scripture.
It may worth noted that when Jesus' reply in Matt 4:7 (Luke 4:12), which quoted from Deu 6:16 has omitted the latter part;
Jesus answered him, “It is also written: ‘Do not put the Lord your God to the test.’" (Matt 4:7)
Do not put the Lord your God to the test as you did at Massah. (Deu 6:16)
The omission is surely not a mistake. It tells 'Do not put the Lord your God to the test' has an eternal implication, and not confined to the days of Israel.
Using another angle to read the same account, the scripture used the word 'tempter' (Matt 4:3 NIV) to describe the devil, implied that the 'tempter' was in a form of human. Since Jesus is God, Then Matt 4:7 is saying a human, or more precisely 'a Christian', shall not put the Lord our God to the test.
How does a Christian capable to test the Lord our God? Isn't the answer is the disobedience to His word? Paul had made a comparison between Adam and Jesus in Romans 5:12-21, in which he wrote
For just as through the disobedience of the one man the many were made sinners, so also through the obedience of the one man the many will be made righteous. (Romans 5:19 NIV)
"The tempter [ὁ πειράζων; tester, trier; Strong's G3985] ..." (MT 4:3 ASV)
"Then the devil [ὁ διάβολος; traducer, opponent, adversary; Strong's G1228] ..." (MT 4:5
"Again, the devil [ὁ διάβολος; traducer, opponent, adversary; Strong's G1228] ..." (MT 4:8 ASV)
If by the foregoing definitions you mean "Satan," then no, Satan did not tempt Jesus. But if you mean the devilish character pictured below, then you might want to reevalute your meaning of the word Satan.