This is an old exam problem at my school:
Let $F\colon M\to\mathbb{R}^k$ be a smooth map of smooth manifolds, with coordinate functions $F^1,\dots,F^k$. Let $c\in\mathbb{R}^k$ be a regular value of $F$, and $C=F^{-1}(c)$. If $f\colon M\to\mathbb{R}$ is smooth, prove $f|_C$ has a critical point at $p$ iff there exist $a_i$ such that $$ df_p=\sum a_idF^i_p. $$
In one direction, suppose $df_p=\sum a_idF^i_p$. I know $d(f|_C)_p\colon T_pC\to\mathbb{R}$, so $p$ is a critical point if $d(f|_C)_p$ is identically zero. But $d(F^i|_C)_p\equiv 0$ since $F^i$ is constant on $C$. It follows then that $d(f|_C)_p\equiv 0$.
On the other hand, if $p$ is a critical point of $d(f|_C)_p$, then $df_p$ is zero on $T_pC$. I know $C$ has codimension $k$ in $M$, but I'm not sure how to finally get that $$ df_p=\sum a_idF^i_p $$ for some $a_i$. I think $T_pC$ is a subspace of codimension $k$ in $T_pM$ as well, do the $dF^i_p$ form a basis or something of the complement of $T_pC$ or something? Thanks.