In the beginning, Ralph is just a 12 year old boy, doing what many boys would do in his situation. He plays in the warm, ocean water. Ralph grabs ahold of the one name Piggy asked not to be called and calls Piggy that. Typical boy actions. He has to mature quickly though when he is placed in charge of the boys. He accepts his duties and tries to be reasonable with the boys, appealing to what he perceives as their combined desire to be rescued off the island. He is civilized and he tries to treat others with civility as best a 12 year old can. By the last chapter, he is being hunted like an animal and he must think like an animal. When he encounters the pig's skull stuck on the stick sharpened at both ends, he knocks the skull off the stick and grabs the stick to use as a weapon. He has degenerated and become as savage as those who are hunting him. When the officer appears at the end to rescue the boys, Ralph weeps for "...the end of innocence, the darkness of man's heart...". Ralph fully understands finally that the beast the boys feared was not an outside opponent, but it lived inside of each one of them. It took him the entire novel to realize what Simon and Piggy both realized much earlier. It also took Ralph the entire novel to finally let out the beast within him. He realizes that he is no better than Jack and the others because he was prepared to kill just as they were prepared to kill.
There are also a couple of passages in the novel that show when Ralph is slowing "losing it." In chapter 7 it shows Ralph daydreaming about home. He does this twice. He longs for normalcy, and he is slowly realizing how different things are going to be if he ever survives this.
In chapter 10, there is one of the two moments where we see Ralph's mind slowly forget what is important. "...that curtain flapped in his head and he forgot what he had been driving at." He's trying to remember how important the smoke is and why they need the signal. This is one way that Golding shows how he's changing.