Let $M \subset R^n$ be a $k$ dimensional manifold. Let $f: R^n \to R$ be a smooth function that satisfies $f(x) = c$, $c \in R$ for every $x \in M $.
I need to prove that $\nabla f(x)$ is orthogonal to $T_xM $ (the tangent space of $x$) for every $x \in M$.
I am not so sure who to approach it, but here is what I tried so far:
Let be $h \in T_xM$. So there exists some smooth function $\gamma: (-a,a) \to M$ ,such that $\gamma(0) = x$ and $\gamma'(0) = h$. Since $f(x) = c$ in $M$, then $f \circ \gamma$ is also constant in $M$. Then I'll get by the chain rule that $\nabla f(x) h = 0$. And thus they are orthogonal.
I am not really sure about my solution. So I am in a need of some assistance. Help would be appreciated.