I am a little bit confused regarding the statement in the first paragraph of the proof.
Since $Y$ is a closed subset of $\mathbb{P}^n$, we can consider the extended morphism from $X$ to $\mathbb{P}^n$. But why it is necessary for the image of the "missing point" $P$ under the extended morphism lies in $Y$ in case we have that unique extension?
I can smell it could be something related to the regular function property, but I could not see explicitly how.
Thank you very much for answering in advance.

This is just irreducibility in action: suppose $\overline{\phi}(p)$ is not contained in $Y$. Then we can write $X= \overline{\phi}^{-1}(Y) \cup \overline{\phi}^{-1}(\overline{\phi}(p))$ where both are closed because they're inverse images of closed sets, and neither is the whole space. This demonstrates that $X$ is reducible, but from the definition and properties of an abstract nonsingular curve explored before this statement, we know that they should be irreducible. So $\overline{\phi}(P)\in Y$.