Snape is one of the most complicated characters from the Harry Potter world. A Slytherin with a hint of love to someone other than himself (obsessive love, but love nonetheless), both Death Eater and member of the Order of the Phoenix, loving one Muggle-born while hating all the rest… Snape is full of contradictions.
The biggest point of Snape’s personality, and the driving force for everything that he does, is his love of Lily Evans. He adores this girl, always has, ever since he first saw her using magic on the playground that fateful day as a child. Snape’s childhood was not a pretty thing. Arguably, his parents were abusive; at the very least, they didn’t love him nearly enough to take care of him. He grew up alone, unloved, jealous of others who had more than he did, and with the old wizarding prejudice against Muggles (non-magical folk). He was always a true Slytherin and didn’t understand compassion, generosity, or friendship. So when he first saw Lily and Petunia playing on the playground, he was confused. He’s always been a grand spy, starting when he was young by watching Petunia and Lily. When he finally announced his presence, Lily’s fervent protection of her sister confused Snape beyond anything he had ever experienced. Since then, he tried to win back Lily’s trust and her love, striving even to forget that she was Muggle-born. He’d never be able to completely destroy the prejudice against Muggles, but at least he could accept that Lily was an amazing witch and by-passed, or ignored, the fact that she was a Muggle-born. His deepest desire was to please her and he refrained from doing or saying anything to or around her that might upset her.
Of course, all of this changed forever the day he slipped up and called Lily a Mudblood. He’d been pushed to the ends of his nerves that day by James Potter, the closest person to an enemy that he had at that point. He loathed James Potter and anything to do with James Potter. James was a Gryffindor, the complete opposite of Slytherin, an arrogant toerag, and he never missed an opportunity to be a complete jerk to Snape. Naturally, Snape wasn’t going to take this lying down and he usually fought back, cementing his hatred for James and everything to do with him. (The fact that James had a thing for Lily made Snape absolutely livid, as he never believed that James deserved her.) So the day Snape finally lost his temper at Lily was a significant day for all of them. James had finally managed to get under his skin more than usual, to the point that he couldn’t hold back his natural instinct - to belittle Muggle-borns, no matter who they were. He regretted it the moment it happened and has ever since because Lily refused to have anything to do with him after that. He hated himself for his slipup. It’s the worst memory of his life and he’s never been able to forgive himself for it, replaying it constantly in his mind. Of course, this made him hate James even more for making him lose his cool at Lily. And when he heard that James and Lily had finally hooked up, he hated himself even more.
The Death Eaters provided a kind of haven from his feelings after graduation. He didn’t have to worry about anyone but himself for a while and he was happy like that. He could forget Lily, forget her new life as Mrs. Lily Potter (the idea of Lily being married to James boils his blood). He was fine until he overheard the prophecy about the boy born in July and relayed it to Voldemort. Upon realizing that this had caused Voldemort to target Lily’s son, and thus Lily herself, Snape panicked. Deep down inside, despite all the years that had passed and his jealousy of Lily’s new life, Snape still loved her and the thought of Lily dead was a huge fear for him. No amount of begging (yes, he loved her enough to beg for her life), seemed to change Voldemort’s mind. There was only one option for someone who had panicked so completely: he met with someone who could save Lily, or so he believed.
Despite not understanding compassion and true love, Snape knew respect and he respected Dumbledore. The older man’s compassion for Lily’s family as well as Lily herself confused Snape, but he’s never been stupid. If it meant keeping Lily safe and happy, he wanted her whole family to be saved. This, of course, brought him to another set of conflicting interests: James. In order for Lily to be happy, James would need to be kept safe as well. Snape still loathed James for everything he was and everything he had, but he asked Dumbledore to keep James safe as well, because that would both make Lily happy and keep her safe.
Snape did everything for Lily. From that moment on, his life was dedicated to keeping her alive and happy. He was willing to risk his life time and again to ensure that nothing would happen to her. He was smart, no doubt, and would argue a point if he thought it wouldn’t come to a good end, but ultimately, if it would help Lily, he’d do it. Hence he turned spy for Dumbledore at the moment Dumbledore promised to keep Lily safe from Voldemort.
Despite all this, despite being a Slytherin, a House known for caring about itself before others, Snape truly does care about the people around him. As he and Dumbledore spoke of what must eventually happen to Harry, Dumbledore asked him how many people he had watched die. “Lately, only those whom I could not save.” Snape does indeed feel remorse for all the deaths he’s helped bring about.
As for Harry, Snape isn’t sure what to feel. On the one hand, this is Lily’s son and he knows he has to keep Harry safe for Lily’s peace of mind. On the other hand this is James’ son and Snape abhors anything that has to do with James. The boy looking exactly like James doesn’t help matters. Snape sees what he expects out of Harry: James’ arrogance and disregard for the rules. So in this regard, Harry confuses the heck out of Snape, who simultaneously hates him with a burning passion and wants to protect his life. Snape doesn’t truly wish harm to befall Harry because of Lily, but at the same time, he thinks it would serve Harry right if the boy got hurt because of his own stupidity. (If the latter happened, Snape would be bound to help him anyway.)
In regard to James’ friends, Snape harbors a sort of interest bordering on obsession with catching them doing something wrong. He’s extremely intelligent and isn’t easily fooled by their disappearing acts, willing to risk trouble to catch them at whatever it is they are doing. He hates them for their bullying and never missed a chance to hex them as they would always hex him if they could.
He’s also gifted at Potions, loving that subject above all others. He’s probably used to being the top of the class in Potions and probably never let certain people live it down. He also is very bright in regards to spells, having created several during his school years, presumably for use against James.