If $\nabla X=h \cdot \text{Id}_{TM}$ for a vector field $X$ and $h \in C^{\infty}(M)$, is $h$ constant? $\newcommand{\id}{\operatorname{Id}_{TM}}$
Let $M$ be a smooth connected closed Riemannian manifold. 
Let $X$ be a vector field on $M$, and suppose that $\nabla X=h \cdot \id$, for some $h \in C^{\infty}(M)$.
Is it true that $h$ is constant? ($\nabla$ is the Levi-Civita connection on $M$).
This is true when the curvature of $M$ is zero. Indeed, we can consider $\nabla X$ as a one form on $M$ with values in $TM$: $\nabla X \in \Omega^1(M,TM)$. Then
$$R_{\nabla} (\cdot,\cdot)X=d_{\nabla}^2X=d_{\nabla}\nabla X =d_{\nabla}(h \cdot \id). \tag{1}$$
Using Leibnitz rule,
$$ d_{\nabla}(h \cdot \id)=h  d_{\nabla} \id-dh \wedge \id=-dh \wedge \id. 
\tag{2}$$
(We used here the fact $\nabla$ is torsion-free and $d_{\nabla} \id$ is the torsion).
Combining equations $(1),(2)$, we obtain
$$ R_{\nabla} (\cdot,\cdot)X=-dh \wedge \id.$$ When $R=0$, this means $dh \wedge \id=0$, i.e
$$ dh(v_1)v_2-dh(v_2)v_1=0$$ for all $v_1,v_2 \in \Gamma(TM)$. This implies $dh=0$, so $h$ is constant.
(In fact, so far we have only used torsion free and $R=0$, with no use of metricity).
 A: $\newcommand{\id}{\operatorname{Id}_{TM}}$No. As a counterexample we can take the vector field $X = \sin(\theta) \partial_\theta$ on the two-sphere with the standard metric $g = d \theta^2 + \sin(\theta)^2 d\varphi^2.$ Near the north pole this looks like the homothetic vector field $X(x) = x$ on $\mathbb R^2$, while near the south pole it looks like $X(x) = -x.$
A coordinate calculation shows that $\nabla X = \cos(\theta)\id,$ since the only non-zero Christoffel symbols are $\Gamma^\theta_{\varphi\varphi} = -\sin \theta \cos \theta$ and $\Gamma_{\theta\varphi}^\varphi = \cos \theta / \sin \theta.$
A: Here is a generalization of Anthony Carapetis's (based on his comments and on some comments by Amitai Yuval).
Consider $\mathbb{S}^n \subseteq \mathbb{R}^{n+1}$, and define $Z \in \Gamma(T\mathbb{S}^n)$ by $Z:=P(e_{n+1})$, where $P=P_{T\mathbb{S}^n}$ is the orthogonal projection on the tangent bundle of $\mathbb{S}^n$.

Claim: $\nabla^{\mathbb{S}^n} Z=-x_{n+1}\text{Id}_{T\mathbb{S}^n}$, i.e. $\nabla_w^{\mathbb{S}^n} Z=-x_{n+1}w$ for every $w \in \Gamma(T\mathbb{S}^n)$.

Let $x \in \mathbb{S}^n$; note that $P_x(v)=v-\langle x,v\rangle x$. ($P_x$ is the projection on $\{x\}^{\perp}$). Hence,
$$ Z(x)=e_{n+1}-\langle x,e_{n+1}\rangle x=e_{n+1}-x_{n+1}x$$
Given $w \in T_x \mathbb{S}^n \subseteq  \mathbb{R}^{n+1}$, let's calculate
$\nabla_w^{\mathbb{S}^n} Z$:
$$\nabla_w^{\mathbb{R}^{n+1}} Z=\nabla_w^{\mathbb{R}^{n+1}}(e_{n+1}-x_{n+1}x)=-\nabla_w^{\mathbb{R}^{n+1}}x_{n+1}x.$$
Since $dx_i(w)=\langle \text{grad} (x_i),w \rangle =\langle e_i,w \rangle=w_i$, we get
$$ -\nabla_w^{\mathbb{R}^{n+1}} Z=dx_{n+1}(w) x+x_{n+1}\nabla_w^{\mathbb{R}^{n+1}} x=w_{n+1}x+x_{n+1}(dx_1(w),\dots,dx_{n+1}(w))=$$
$$ w_{n+1}x+x_{n+1}w.$$
So,
$$ -\nabla_w^{\mathbb{S}^n} Z=-P(\nabla_w^{\mathbb{R}^{n+1}} Z)=P(w_{n+1}x+x_{n+1}w)=x_{n+1}w.$$
(Note $P(x)=0$, $P(w)=w$ since $w \perp x$).
