>How did he not go to jail?
Travis was instead heralded as a hero by the society he tried to condemn, by saving a child prostitute from the pimps and gangsters, etc
>How did he survive?
Well, there's an ongoing debate on whether he did survive or not. Everything after the climax could easily be viewed as Travis' fantasy. It's up to interpretation.