The word ??????? (Christos), translated as both Messiah and Christ, occurs 19 times in the Gospel of John. ^^. The word is first used in the prologue (1:17). Messiah was an OT expectation held by most observant Jews, so there is particular significance that the first time that Jesus is called the Messiah is where John contrasts Jesus and the law of Moses.
Throughout the gospel, many people discuss whether Jesus is the Messiah, and the discussions form part of the structure of the first half of John. Early in the gospel, John declares that he is not the Messiah, but that he is preparing the way (1:20-23). He says it again later, in context to Jesus ministry eclipsing his, and clearly indicates that Jesus was the Messiah whom he was preparing the way for (3:26-30). John pointed his disciples towards Jesus very early in the gospel, and they also believed that he was the Messiah (1:41, 49). By chapter 4, people outside of the circle of disciples were beginning to suspect that Jesus was the Messiah. Significantly, the first was a Samaritan woman (4:29). After the feeding of the 5000, the Galileans attempt to make Jesus King through force, which is a clear reference to the kingly expectations of the Messiah (6:15). Chapter 7 contains an extended discussion amongst the crowds in Jerusalem about Jesus, and the focal point is whether he is the Messiah. Many of the people believe that he is, and others believe that he is not (7:41-44). In the raising of Lazarus which is a critical point in the Gospel Mary declares that Jesus is the Messiah (11:27).
Throughout this discussion, Jesus only directly declares himself to be the Messiah once to the Samaritan woman (4:25-26). However, as public opinion develops, he engages with their concerns and reasons not to believe. In chapter 7, he engages with the discussion about the Messiahs origin some thought that his origin would be a mystery, some thought it would be Bethlehem (7:26-27, 41). In response, he declares that do know his origin, but implies that they do not, because he is from God (7:28-29). Finally, Jesus is asked the direct question, and he declares again that his works are the proof that he is the Messiah (10:24-25 cf. 7:30). The reasons for this gradual revelation are most likely the same as the reasons for the messianic secret in the synoptic Gospels. One of these is that public expectations of the Messiah were military, and people claiming to be the Messiah often started armed revolutions (ie. Bar Kokhba. cf. John 6:15).
The climax of the debate comes at the end of the first half in the triumphal entry. There Jesus publically fulfils Messianic prophecy, and the crowd declares him to be the King of Israel (12:12 ff.). However, the summary in 13:37 ff. showed that, though some put their faith in Jesus, most did not. Of those who did, many hid their faith because they were afraid of the authorities who had declared that anyone supporting Jesus would be expelled from the synagogue (7:13, 9:22, 12:42-42). This mounting opposition led to Jesus trial, and his claim to be the Messiah was the central charge against him before Pilate. Though Jesus refuses to answer directly, Pilate constantly calls him a King, and that is what is written on the notice on the cross. John also shows that Jesus death, by gathering the people of God, fulfils the prophetic expectations for the messiah (11:51-52, 12:32).
These constant discussions throughout the book show that, more than any other Gospel, John is concerned about showing Jesus to be the fulfilment of Israels messianic expectations. In the later part of the Gospel, he reveals why:
This is eternal life: that they may know You, the only true God, and the One You have sent-- Jesus Christ. John 17:3 (HCSB) But these are written so that you may believe Jesus is the Messiah, the Son of God, and by believing you may have life in His name. John 20:31 (HCSB) John clearly links eternal life to understanding that Jesus is the Messiah. The language is not exclusive, and so cannot be read as supplying a universal requirement for salvation for all people. However, throughout the book, those who believe that he is the Messiah choose to follow him, and those who do not reject him.