In The Godfather: Part II Fredo betrayed Michael by giving Ola and Roth information that helped to make an attempt on Michael's life at his home. Fredo was careless and naive (which Roth used to his advantage), and he probably didn't have any actual bad intentions against Michael. According to Fredo's words:
Fredo: Johnny Ola bumped into me at Beverly Hills, and he said that he wanted to talk. He said that you and -- and Roth were in on a -- a big deal together and that there was something in it for me if I could help 'em out. He said that -- He said that you were bein' tough on the negotiations, but if they could get a little help and close the deal fast, it'd be good for the family.
Michael Corleone: You believed that story? You believed that?
Fredo: He said there was somethin' in it for me. On my own.
Fredo did not know that Roth would try to kill Michael:
Fredo: Mike. I swear to God, I didn't know it was gonna be a hit.
Fredo wasn't lying. After attack on Michael Johnny Ola called Fredo:
Johnny Ola: Everything will be all right Pentangeli says he's willing to make a deal. All we want to know is if he's on the level, or if he's gonna bring his boys.
Fredo: You guys lied to me. I don't want to talk to you anymore.
Well, Fredo really crossed the line several times. He is a naive, weak person. He wanted some respect from the family. But does he deserve to be killed? In The Godfather 2 at Michael and Fredo's mom's funeral when Michael approached Fredo, he embraced him, and it seemed that Fredo was really sorry for what he had done. It was clear that Fredo had changed. It was unlikely he would betray Michael again. He perceived that he crossed the line, and he regretted his actions. He was weak and helpless and needed support. Why kill him? Why did Michael not forgive his older brother?