Let $M$ be a differentiable manifold, let $f:M\rightarrow\mathbb{R}$ be smooth and let $v,w$ be vector fields in $M$. Must it be true that $\nabla_w(\nabla_vf) = \nabla_v(\nabla_wf)$ where $\nabla$ denotes the covariant derivative? If so I would like a proof and if not a counter example. Also, to motivate this question, it seems to me that one can ask this independently of picking a riemannian metric. Because of this, if one had a counter example, then one should be able to put any metric on the space (in particular a flat metric) which would give rise to non commuting derivatives for a smooth function in $\mathbb{R}^n$ which never happens. Because of this I suspect this equality must hold, however I am still unsure.
To clarify, the reason I think one can ask this equality without picking a metric is that to my understanding $\nabla_vf$ is defined independently of the metric and results in a function from $M\rightarrow\mathbb{R}$. That is to say, the covariant derivative of a function from the manifold to the reals with respect to a vector field is itself a function from the manifold to the reals and this is defined independently of the metric.
Here is why I think the covariant derivative is defined independently of the metric. Say you have a vector field $v$ and real valued function $f$ on the manifold. To get the covariant derivative at a point $p$ we take the vector of the vector field $v$ at $p$ (call this vector $v_p$) and we consider some function from $\phi:\mathbb{R}\rightarrow M$ such that $\frac{d}{dt}\phi(t) = v_p$. Then the covariant derivative is defined as $\frac{d}{dt} f(\phi(t))$ which is a real because $f\circ\phi$ is a map from $\mathbb{R}$ to $\mathbb{R}$. At no point is the metric required in this definition. Also, I don't think use of the metric is hiding in the definition of the derivative of a map from the reals to the manifold because a tangent vector can be defined as an equivalence class of functions from the reals to the manifold that all have the same derivative when passed through some chart of the smooth manifold.
It is quite likely my confusion stems from some miss understanding which is present in my above explanation in which case please point this out to me. Thanks for taking the time to read this post.