Let $M$ be a smooth manifold and let $Q$ be a submanifold of $M$. Consider two vector fields $X, Y \in \mathfrak{X}(M)$ such that $X_q, Y_q\in T_qQ$ for every $q\in Q$. Prove that $[X, Y]_q\in T_qQ$ for every $q\in Q$.
So, I came across the following proposition in Lee's "Introduction to Smooth Manifold":
Proposition 8.22. Let $M$ be a smooth manifold, $S\subseteq M$ be an embedded manifold with or without boundary, and $X$ be a smooth vector field on $M$. Then $X$ is tangent to $S$ if and only if $(Xf)|_S=0$ for every $f\in C^\infty(M)$ such that $f|_S\equiv0$.
Thus, I thought that I have to show that, for $f\in C^\infty(M)$ such that $f|_Q=0$, we have $[X, Y]_q(f)=0$. But $[X, Y]_q(f)=X_q(Y(f))-Y_q(X(f))=0$ because $Y(f)$ and $X(f)$ are smooth functions on $M$ that vanish on $Q$ and $X_q$ and $Y_q$ are in $T_qQ$. So, I thought that I was done, but my instructor said that this doesn't prove that $[X, Y]_q\in T_qQ$. I don't really understand why, could anyone please explain this to me?