In the picture (P106 Do Carmo, Riemannian Geometry), why the red line implies $K = const$. I have two questions about this.
I have seen in another answers, which strictly follows the hint in the book. It says $X(K)=0, \forall X \in TpM $ implies $K=const$ in a neighborhood of $p$. Why does $K=const$ in a neighborhood of $p$? I think, from $X(K)=0, \forall X \in TpM $, we only can say that in any coordinate neighborhoods $U$ about $p$, all partial derivatives of $K$ at $p$ (not $U$) are zero. But how could we say that $K=const$ in a neighborhood of $p$?
Starting from the blue arrow, I think, by the arbitrariness of $p$, we have for any $p\in M$, $X_p(K)=0, \forall X_p \in T_pM$. So the partial derivatives of $K$ are identically zeros on $M$, which means that $K=const$. But, in this way, the connectedness of $M$ would be redundant. So where did I miss?
Edit
Why does $(df)_p=0, \forall p \in M$ only implies $f$ is locally constant (why is $f$ not globally constant). The following is my thinking.
In Euclidean space, if all partial derivatives of $f:R^n \rightarrow R^m$ are identically zero on $R^n$, then $f$ is constant on $R^n$ (no need for connectedness). Back to this exercise, for the "locally constant", is it because the coordinate neighborhoods? More precisely, at any point $q \in M$, for a chart $\{\phi, U\}$ ($\phi : U \in M \rightarrow R^n$) about $q$, $df=0$ on $U$ implies $f \circ \phi^{-1}$ is constant on $\phi(U)$. This in turn means $f$ is constant on $U$. So, the "$f$ is locally constant" you mentioned is that $f$ is constant on every charts.
