Jesus answered them, “Is it not written in your Law, ‘I have said you are gods’?

Jesus is quoting (Psalm 82:6). Strictly speaking, “the Law” refers to the Pentateuch, the first 5 books of the Bible, but the term was widely used to refer to the entire Old Testament.

Psalms 82:6  “I said, ‘You are “gods”; you are all sons of the Most High.’

“gods” = elohim in the Hebrew in Psalms 82. The passage refers to the judges of Israel who were the commissioned representatives of God, acting on His behalf and by His delegated authority to bring help and justice to men. Since they had been commissioned by God’s word to them (compare Luke 3:2 where God commissions John), and are His representatives (cf. 1Sam 24:6-7), they are often referred to as “gods” (Ex 21:6, 22:9, 28). (Elohim is translated as “judges” in the first 2 of these verses.) Edersheim notes that “The comparison made was not with prophets, because they only told the word and message from God, but with Judges, who, as such, did the very act of God.” The judges were supposed to be God’s representatives to the extent that men could look at their judgments and acts and see how God would act in such a circumstance.

Luke 3:2  during the high priesthood of Annas and Caiaphas, the word of God came to John son of Zechariah in the desert.

1 Samuel 24:6-7  He said to his men, “The LORD forbid that I should do such a thing to my master, the LORD’s anointed, or lift my hand against him; for he is the anointed of the LORD.”  With these words David rebuked his men and did not allow them to attack Saul. And Saul left the cave and went his way.

Exodus 21:6  then his master must take him before the judges. He shall take him to the door or the door-post and pierce his ear with an awl. Then he will be his servant for life.

Exodus 22:9  In all cases of illegal possession of an ox, a donkey, a sheep, a garment, or any other lost property about which somebody says, ‘This is mine,’ both parties are to bring their cases before the judges. The one whom the judges declare guilty must pay back double to his neighbour.

Exodus 22:28  “Do not blaspheme God or curse the ruler of your people.