I have an issue with understanding the notation of the following definition of partial derivative
$$ \left. \frac{\partial}{\partial x^i} \right|_{p} f := \frac{\partial f}{\partial x^i}(p) := \frac{\partial \left( f \circ \phi^{-1} \right)}{\partial r^i}(\phi(p)) := \left. \frac{\partial}{\partial r^i} \right|_{\phi(p)} \left( f \circ \phi^{-1} \right). $$
What I cannot really figure is if the following is actually well posed
$$ \frac{\partial f}{\partial x^i}(p) := \frac{\partial \left( f \circ \phi^{-1} \right)}{\partial r^i}(\phi(p)) $$
Because I don't really understand the meaning, to me the idea should be to transform the partial derivative of a function defined on a manifold to a partial derivative of a function defined in a open set of $\mathbb{R}^n$. Now if we look at the RHS of the last equation I wrote we have $f \circ \phi^{-1}$, which is a function from an open in $\mathbb{R}^n$ to $\mathbb{R}$, however the variable w.r.t. we differentiate is also a function from $\mathbb{R}^n \to \mathbb{R}$.
My question is, why is such definition well posed?
Let $g = f \circ \phi^{-1} : V\to \mathbb R$ which is defined on an open subset of $\mathbb R^n$. The meaning of $$\frac{\partial g}{\partial x^i}$$ is clear (although in multivariable analysis usually $x_i$ is written instead of $x^i$). Tu writes it in the form $$\frac{\partial g}{\partial r^i}$$ to avoid confusion with the local coordinates $x^i$ on $U$ introduced by $\phi : U \to V$. It is just the usual partial derivative of $g(r^1,\ldots,r^n)$ with respect to the $i$-th coordinate.
I think you are confused because Tu says
We may of course regard the $r^i$ and $x^i$ as coordinate functions living on $V$ and $U$, but this does not affect the meaning of $\frac{\partial g}{\partial r^i}$. You must not interpret this as a special case of an expression $\frac{\partial g}{\partial \psi}$ where $\psi : U \to \mathbb R$ is some function - such a concept does not exist.