Matthew 11:2-5, 7, 10-11 (NET) “Now when John heard in prison about the deeds Christ had done, he sent his disciples to ask a question: 3 ‘Are you the one who is to come, or should we look for another?’ 4 Jesus answered them, ‘Go tell John what you hear and see: 5 The blind see, the lame walk, lepers are cleansed, the deaf hear, the dead are raised, and the poor have good news proclaimed to them’…Jesus began to speak…10 This is the one (John the Baptist) about whom it is written: ‘Look, I am sending my messenger ahead of you,  who will prepare your way before you.’ 11 I tell you the truth, among those born of women, no one has arisen greater than John the Baptist. Yet the one who is least in the kingdom of heaven is greater than he is.”

The Bible accurately relates the facts. Even when a person is specially honored and loved by God, that person’s struggles and failings are truthfully recorded

When John asked this question, he was in a dark and miserable prison. He knew that he could be executed at any time. It may be that John was discouraged. Furthermore, he knew he was to fulfill the prophecy of Malachi 3:1, “Behold, I will send my messenger, and he shall prepare the way before me.” John’s mission was to preach repentance to the Jews. This message was to prepare them to receive Jesus. John may have been questioning if he had been faithful in his work. Therefore, he sent two disciples to ask Jesus if he was indeed the Messiah. Jesus answered his question by the proofs of his works.

There is a different answer to your question. The interpretation was that John was not asking the question to settle his own mind. Instead, John knew his ministry was ending, and he wanted to direct his own disciples to turn and follow Jesus. Thus, Jesus’s answer would give John’s disciples strong proofs and would strengthen their faith to follow Jesus.

Please note that Jesus did not find fault with John. He honored John by saying, “Among them that are born of women there has not risen a greater than John the Baptist,” Matthew 11:11. 

Additional Resources: 
Christian Questions Podcast 
Episode # 1302: “How Can I Doubt My Doubts? (Part I)” 
Learning the difference between constructive and destructive doubt
(An audio discussion of this specific question starts at the time of 00:49:19)
CQ Rewind Show Notes

Episode #995: “What Made John the Baptist So Special?” 
Uncovering “greatness principles” in the life of John the Baptist  
CQ Rewind Show Notes