Question: are nagato and pain the same person?
Answer: Pains were just a corpse which were being controlled by Nagato. One of the body of Pain was of his beloved friend Yahiko, who was considered as the main, strongest pain out of all pains. In Conclusion, Pain and nagato were not the same person. Pain was just a part of Nagato.