Pi's religious views can be very confusing. He is a follower of Hindu, Islam AND Christianity. Most people would find this strange but Pi believes that people have the freedom to believe what they wish. He wants to love God, in a more general sense. It is difficult to describe Pi's religious views. For more information watch the video at the link below.
At the end of chapter seven, Pi describes his opinion of belief and his disapproval for agnostics saying, "It is not atheists who get stuck in my craw, but agnostics. Doubt is useful for a while... But we must move on. To choose doubt as a philosophy of life is akin to choosing immobility as a means of transportation". Pi has a strong passion for belief, and disapproval of doubt. He preaches that people need to believe in something, whether it is science or religion. If Pi were to have the perspective of an agnostic, later in his story it would be less likely for him to survive. When Pi becomes stranded on a lifeboat faith gives him hope. It makes him not give up and yearns him to push for survival instead of giving in to the ocean and its hardships.
It is not to say that Pi never has doubt. Like anyone would, Pi becomes torn with grief, fear and anxiety. He goes from being safe with his family on a cargo ship, to being stranded on a lifeboat in the middle of the ocean, practically alone. He is surrounded by sharks, a hungry hyena and tiger, and a vast ocean. He has no help and barely any chance for survival. His family is likely dead, and soon he will likely be too. In this situation, it is hard to have any spirit. It would be easy to take an agnostic view and doubt God. Questions like; Why would God let this happen? And what did I do to deserve this? would come to mind. However Pi passes the test of doubt. Yes he questions his survival and negative thoughts play on his mind, but he manages to overcome all of that and keep faith.
In the quote from chapter seven, Pi explains that it is natural to have doubts, but you must move on from that. This is exactly what he does. He pushes through the hardships and manages to survive. He doesn't stray from his original values of what he wants himself to be and he does not chose "doubt as a philosophy in life". It is because of this that Pi is able to survive.