Richard Parker is a psychological allegorical figure that serves as a physical manifestation of Pi's shadow or id. Carl Jung, a Swiss psychodynamic psychologist, described the shadow as the hidden, dark side of our personality. It can be considered a fundamental part of the psyche, more specifically, the id, which according to Sigmund Freud, is the entirely unconscious, irrational, instinctual part of our psyche. It operates on the pleasure principle and relies of instincts and innate drives. The shadow is entirely hidden and also shows itself as we try to defend ourself through defensive mechanisms such as projection.
Based on this, I believe that Richard Parker is nothing more than a figment of Pi's imagination. In the retelling of the story none of the animals are present, which lead me to believe that Richard Parker is largely symbolic. Richard Parker is essential to Pi's survival on the lifeboat, because without him, he lacks the basic drives and instincts of human nature which is required for his survival on the lifeboat. Richard Parker frequently tests Pi's resilience and activeness throughout the journey and prompts him to maintain his human qualities.
The shadow can be both Pi's "best friend and worst enemy", as it constantly provides Pi with the basic human instincts which are needed for him to survive. However, he likes rationality which may also increase Pi's chances of survival. It provides Pi with instant gratification, but may harm him in the long run in ways that are not yet seen.
Whether or not Richard Parker is a figment of Pi's imagination or not, I strongly believe him to be an allegorical figure that represents Pi's heavily conflicted psyche, mainly the irrational, impulsive shadow which heavily and regularly prompts him to keep in touch with reality and positively encourages him to survive.