Rick starts out as a sheriff's deputy in episode one. As part of the living world he is tough and does not hesitate to do what needs to be done: he and Shane set up a trap for the car fleeing law enforcement from another county. We see Rick give instructions to the other officers present: he is a leader, and not gun-shy.
Fast forward to him waking up in the hospital. His character has no idea what is going on: he is along, and the hospital looks like a war zone. Through interacting with Morgan he learns about the world and begins changing by accepting what he sees as the new truth. We know this because:
- He goes back to kill Bicycle Girl.
- Rewind to the prologue of season 1 episode 1, he kills a little girl walker.
For a law enforcement officer who is portrayed as tough yet virtuous to commit these acts shows that even early on, Rick is changing.
The next event is really two separate events linked together. Before leaving the CDC, Dr. Jenner tells Rick
Everyone is infected and will turn when killed.
Fast forward to the end of season 2,
Rick shoots and kills Shane in self-defense, only for Shane to turn and Carl kills Shane as a walker.
This puts the grim reality into perspective: Shane was a close friend of Rick's from childhood. Even though the group has had to kill some of their own up until this point, this event really hit home: it made it personal.
Moving on to season 3 there are two primary motivations for him changing. First,
the death of his wife
That type of event would change anyone, zombie apocalypse or not. If the previous death left anything to doubt, that nail is now firmly hammered in.
Next, a collection of events: The Governor's relentless assault against the prison over the course of much of season 3 and part of season 4.
Rick's interaction with The Governor is an interesting one. The Governor is ruthless because he too has lost so much and is willing to do anything to protect what he has now. The interesting thing here is Rick appears to take on some of The Governor's attributes, specifically, his willingness to do whatever it takes to protect his (extended) family. Once you earn Rick's trust, he will do almost anything to protect you. While most characters value the group, only Carol seems to be willing to do anything and everything to protect it. This changes as The Governor's ruthlessness "rubs off" on Rick, although he does keep some compassion. Rick does not become a sociopath, using others for personal gain the way The Governor does.
Anyway, we see several interactions between Rick and The Governor, and the latter makes it abundantly clear that it is all-out war and Rick better surrender or die fighting. While Rick regresses at the start of season 4, we see him change back to being tough and in fact going above and beyond what he used to be:
- He brutally kills police officers in Atlanta in his quest to save one of his group.
- While he gets beat up by The Governor, he fights, not flees, during the final attack on the prison.
- He stops coddling Carl and starts teaching him how to survive.
- Right before Terminus, he literally takes a bite out of one of his attackers, prompting Michonne and Daryl to join in what turns out to be an all-out slaughter.
- He started the chase in Terminus by threatening his "saviors."
The last two points are very important: he literally chewed flesh from another living human, and waltzed into a safe zone outgunned and outmanned and threatened them to try to save his friends who he believed were nearby. The only talking he did was at gunpoint. He was ready to murder them.
In season 5, the major event in his evolution was Alexandria. Leading up to that point, we see he is tough and ragged, trusting nobody not in his group. Being in a safe zone, nothing changes: he schemes with Carol and Daryl to stash weapons and to create a Plan B in case this "safe zone" turns out like two others they encountered, Woodbury and Terminus. He reiterates the point that the people of Alexandria mean nothing, only the people in their group matter. If push comes to shove they will revolt and take it from them. Given how soft many of the residents are, they are basically "not of this world" and deserve it.
As season 5 ends, we see the story lead in that direction:
Rick is on "trial" by who I call "The Governess" for doing what had
to be done. Rick doesn't abide beating one's wife, and is willing to
start a revolt if need be due to leaders' tolerance of such deeds.
Since the question specifically mentioned "the end of season 5" I will stop here for now.