What clues were left by Rowling which pointed toward the fact that Snape was good guy?
Going to skip over stuff like "Infusion of Asphodel and Wormwood" because it sounds like people are reading too much into stuff. Sticking with the subtle stuff that actually has an explanation in the books.
Snape saving Harry in the Quidditch match from Quirrell.
Snape threatening Quirrell in the middle of Sorcerer's Stone, which first serves to antagonize Snape, but later we know that Quirrell is the bad guy after all which meant that Snape was against him.
Snape giving Harry fake Veritaserum and understanding Harry's reference of "Padfoot".
Snape giving Lupin the correct Wolfsbane potion throughout the year. He could have easily tampered with it and called it an "accident".
The biggest hint that most people overlook is that it's practically revealed that Snape is a terrific Occlumens. This actually answers the question of how he is able to stand up to a Voldemort who is an accomplished Legilimens himself.
Snape doesn't reveal the location of No:12 Grimmauld Place after the death of Dumbledore. It could have served as a good hiding place/ could have had mentions of the Order's plans.
While this clue can't be inferred the first time, if you read the series more than once, you can find that all of Snape's insults are aimed at James, and he never speaks of Lily. If Snape personally knew the Marauders when he was at school, surely he must have known Lily who was in the same year he was. But he never makes mention of her.
Another brilliant hint is 'Snape's Worst Memory'. When we read it first, we think it's his worst because James and the others insulted him before the entire school, but it's only later we know that it was his worst because he called Lily a Mudblood and drove a permanent wedge in their relationship.
Hagrid says during Order of the Phoenix (or was it Half-Blood Prince?) that he overheard Dumbledore and Snape arguing and that Dumbledore remarks that since Snape said he'd do it, he'd have to. This is just a comment made in passing, but it has deeper ramifications because we later learn it is when Snape is told that Harry is the last Horcrux.
There is also a pretty good exchange between Harry and Dumbledore in Half-Blood Prince when Harry discovers that Snape was the one who leaked the prophecy to Voldemort. Dumbledore tells Harry that Snape was very distressed after he found out that the prophecy referred to Harry's parents. Harry laughs at that and says that Snape hated Harry's father, so he couldn't have felt remorse. At this point, Dumbledore (who so far tried to counter Harry's reasons) tries to pacify him. Dumbledore usually throws out facts and hunches to try and gain the upper hand in a conversation, but now he's trying his best to change the topic. This is again a hint that Snape's past is not what it seems.
Of course, the biggest hint is Dumbledore's steadfast trust in him. It's like Hermione says: "If we can't trust Dumbledore, we can't trust anyone."
While not a part of the books, another dead giveaway is in the movie Prisoner of Azkaban, where Snape shields the trio from the werewolf form of Lupin. Until that point, Snape was talking about calling the dementors over and making them perform the kiss on Lupin and Sirius, but when Lupin actually transformed, he put the students' safety as a priority. Obviously, the watchers interpreted it as a teacher trying to save the students, but it turns out that wasn't the only thing.