"Then Jesus spoke to them again, saying, 'I am the light of the world. He who follows Me shall not walk in darkness, but have the light of life.' The Pharisees therefore said to Him, 'You bear witness of Yourself; Your witness is not true.' Jesus answered and said to them, 'Even if I bear witness of Myself, My witness is true, for I know where I came from and where I am going; but you do not know where I come from and where I am going. You judge according to the flesh; I judge no one. And yet if I do judge, My judgment is true; for I am not alone, but I am with the Father who sent Me. It is also written in your law that the testimony of two men is true. I am One who bears witness of Myself, and the Father who sent Me bears witness of Me.' Then they said to Him, 'Where is Your Father?' Jesus answered, 'You know neither Me nor My Father. If you had known Me, you would have known My Father also.' These words Jesus spoke in the treasury, as He taught in the temple; and no one laid hands on Him, for His hour had not yet come" (John 8:12-20).
"Light" is often used as a figure for truth (cf. Psa. 119:105; John 3:19-21; etc.) and "darkness" as a symbol for error and ignorance. Jesus is the "light of the world" in that He is the possessor and bearer of light to mankind (not just to Israel), having come into the world to make the way of the Father known. Those who follow Jesus do not walk in the darkness of error (cf. I John 1:7) but are privileged to have "the light of life" and become light-bearers to others (cf. Matt. 5:14-16).
The Pharisees responded to Jesus - "You bear witness of Yourself; Your witness is not true" (cf. John 5:31ff). For a person to testify of himself does not inherently make his testimony false, but it does make it suspicious or doubtful. However, Jesus had no intentions of testifying of Himself alone (cf. 8:18).
The fact that certain Pharisees are present here, though others had shamefully left earlier (cf. 8:9), is easily explained in that they had probably been amongst the crowd for some time but did not actively participate in bringing the woman caught in adultery to Jesus.
Jesus knew where He came from and where He was going (both physically and spiritually). His listeners did not know these things about Him. In fact, they couldn't even testify of their own nature (i.e., regarding their beginning and end), much less judge that Jesus wasn't the source of life and light as He had claimed.
Our Lord stated in John 8:15 - "You judge according to the flesh; I judge no one." They judged Jesus in a superficial manner by what they saw. They thought they knew about His background and family. They didn't "judge with righteous judgment" (7:24). Jesus stated that He judged no one, but this must be understood in context to mean that He judged no one according to the flesh (cf. 8:16; I Sam. 16:7).
"And yet if I do judge, My judgment is true" (John 8:16). It is true that Jesus didn't come into the world to condemn it but to save it (cf. 3:17), but it is the case that He did occasionally exercise judgment against wicked men while on earth (cf. Matt. 23:1ff). Of course, any judgment He did render was true for it came from the Father (cf. John 8:26) who was with Him.
Jesus then returns to the point they brought up regarding His witnessing of Himself being invalid. He referred to Deuteronomy 17:6 and 19:15. Jesus had two witnesses: Himself and His Father, the One who sent Him (cf. John 5:31ff for additional witnesses). If the testimony of two men was enough to establish something as true, how much more would the testimony of two divine voices establish the validity of Jesus' claims!
"Where is Your Father?" (John 8:19). The Pharisees do not ask who His Father was but where He was. They wanted Him to produce this absent, unseen witness.
Jesus responded - "You know neither Me nor My Father." The use of the word "know" here does not mean to have knowledge about God; it means to have an intimate relationship with Him. These Jewish people did not have this because they refused to know Jesus, and one cannot truly know the Father without knowing His Son (cf. 14:7; 17:3).
John informs us that Jesus' words in this passage were spoken in the temple in the place where financial offerings were made (i.e., "the treasury"). This was said to be very near to the place where the Sanhedrin council met. This surely shows the great danger that Jesus was facing here. But, no one arrested Him "for His hour had not yet come" in the divine plan.