Did Jesus Witness For Himself?

Skeptics and critics have alleged that Jesus’ words in the gospel of John contradict about whether or not Jesus witnessed for himself. Did Jesus witness for himself?
ALLEGED CONTRADICTION:
“According to the Gospel of John, what did Jesus say about bearing his own witness?
(a) “If I bear witness to myself, my testimony is not true” (John 5:31)
(b) “Even if I do bear witness to myself, my testimony is true” (John 8:14)”
What Jesus was referring to in John 5:31? Was he saying that if he witnessed for himself his testimony wasn’t true?