The following question was asked in my quiz on smooth manifolds and I couldn't do it.
Let S be a connected submanifold of M, with $i: S\to M$ being the inclusion map. Let $f: M \to \mathbb{R}$ be a smooth function. If for all $p \in S$, $di_p(X)(f)=0$ for all $X\in T_PS$, show that f is constant on S.
$di_p$ is a linear map from $T_p M \to T_{i(p)}N$. $X\in T_pS$ implies that X is a linear map from $T_p(S) $ to $\mathbb{R}$ satisfying Liebnitz rule at p.
$di_p(X)(f)=X(f(i))$, f(i(x))= f(x) and f is smooth means that there exists chart $(U,\phi)$ of M and $(V,\psi)$ of $\mathbb{R}$ such that $ (\psi)f(\phi)^{-1}$ is smooth.
But now how to use the fact that $X(f)(i)=0$ implies that f is constant?
I am not able to figure it out.