Jesus told Peter that He knew that he'd betray Him. Peter denied it. When they were in the city and people began to recognize Peter as one who had followed Jesus, he denied it three times as Jesus had said he would. The first time he just shrugged it off. The second time he was a bit worried but still insisted he was not with Jesus. The third time someone said to him "you were with him,your speech say so." Then this is where Peter went delirious and began shouting and cursing like a wild man that he did not know Jesus Christ. The cock crew and Peter immediately remembered the words that Jesus had said unto him and he went away and cried bitterly.
We cannot hide, alter or deny our true identity. Although Peter denied Jesus, the people still knew who he was. No matter how much he tried to get away, the people kept coming to him and telling him that he was definitely one of the followers. Peter became so overwhelmed from the people's conviction that he became enraged. He wasn't mad at them but at himself. The thoughts that engulfed his mind were probably the time he had spent with Jesus and all that he was taught. Then Jesus' word came to mind.
Peter had it all wrong. The reason we learn Jesus' word and worship and praise and all of the sort is to help us rise in times of hardship. He remembered Jesus' word after the fact when he should have remembered before. He went out of his mind when he should have prayed for stability. I am not judging Peter because this had to be done to fulfill the Word that was spoken of God but I can learn from his mistakes.