Javert was born in prison, and his parents were a convict and a fortune-teller. As he grows up, he starts working as a correctional officer and then joins the police and becomes a police inspector. His only life goal and purpose is to trust the law and make others obey it. He shows passion only toward his work, and nothing else matters to him. He respects authority and order in all their forms and stands against revolt and disobedience — everything he does shows his uncompromised devotion to his job. Moreover, he arrests criminals not just because of duty but because he receives true pleasure due to that. He is the one who arrests Fantine and takes Jean Valjean back to the prison.
His life changes when Jean Valjean saves him from an attack of a gang of rebels and lets him go. This act breaks everything that Javert believed in and makes him uncertain of what to do. Uncertainty is the most difficult and terrible feeling for Javert as for all his life; he has always been certain in what he has to do to ensure order and power of authority. As a result, he hesitates as he does not know whether to choose his sense of duty and arrest Jean Valjean or to follow the moral sense and let him go. The fact that Valjean could have left him and in this way, could have saved himself from the arrest but, decided to save the life of the policeman makes Javert rethink what he believes is true and certain.