Conservative Covector Fields are Exact $\newcommand{\R}{\mathbf R}$
I am trying to understand the proof of the following:

Theorem. Let $M$ be a smooth manifold and $\omega$ be a smooth covector field on $M$. Then $\omega$ is conservative iff it is exact.

The fact that exactness implies conservativeness is clear.
The other direction is more interesting.
I am following the proof given in Lee's Introduction to Smooth Manifolds (Theorem 11.42).
Proof. Assume $M$ is connected and $\omega$ is conservative. We need to show that $\omega$ is exact. For two points $p$ and $q$ in $M$, we write $\int_p^q \omega$ to denote the line integral $\int_\gamma \omega$, where $\gamma$ is any piecewise smooth curve starting at $p$ and ending at $q$.
This notation is unambiguous because of the conservativeness of $\omega$.
It is easy to guess a candidate $f:M\to \R$ such that $df=\omega$.
Fix $p_0\in M$ and define $f:M\to \R$ (just a set map as of now, no smoothness claimed yet), as
$$f(q)=\int_{p_0}^q\omega$$
for all $q\in M$.

Main Question. To show that  $f$ defined above is smooth.

For me it is enough to understand why $f$ is smooth at $p_0$.
We may further assume, by passing to a smooth chart, that $M=\R^n$ and $p_0=\mathbf 0$.
So the main question is revised to:

Revised Main Question. Take $M=\R^n$ and $p_0=\mathbf 0$. To show that $f$ defined above is smooth at $p_0$.

The rest of the proof now goes like this:
Let $\epsilon>0$. Fix $j$, and let $\gamma:[-\epsilon, \epsilon]\to\R^n$ be defined as $\gamma(t)=(0, \ldots, 0, t, 0, \ldots, 0)$, where $t$ is in the $j$-th place.
Let $p_1=\gamma(-\epsilon)$, and define $\tilde f:\R^n\to \R$ as
$$\tilde f(q)=\int_{p_1}^q\omega$$
It is clear that the difference $f-\tilde f$ is a constant.
So it is enough to show that $\tilde f$ is smooth.
Now we have:
$$\tilde f\circ \gamma(t)=\int_{-\epsilon}^t\omega_j(\gamma(s))ds$$
where $\omega_j$ is given by $\omega=\omega_1dx^1+\cdots +\omega_ndx^n$.
By fundamental theorem of calculus this shows that $\tilde f\circ \gamma$ is smooth and we get
$\frac{\partial \tilde f}{\partial x_j}(p_0)=\omega_j(p_0)$.

What I do not Understand. But I do not see how does this prove that $\tilde f$ is smooth. It only shows that the partial derivative exists.

What am I missing?
 A: Once we've shown that the first partial derivatives of $f$ in coordinates exist and are equal to the components of $\omega$, it follows from the fact that $\omega$ is smooth (which is part of the hypothesis of the theorem) that the first partial derivatives of $f$ have continuous partial derivatives of all orders, and thus $f$ is smooth. (I noted this later in the proof. See the last sentence in the first paragraph on page 294: "Since the component functions of $\omega$ are smooth and equal to the partial derivatives of $f$ in coordinates, this also shows that $f$ is smooth.")
A: Here is a separate proof that $f$ is smooth on $U$.
If we assume that $U$ is a coordinate ball, then for any $q$ in $U$ we have the straight line path $\gamma: [0, 1] \to U$ from $q_0$ to $q$ given by
$$\gamma(t) = \varphi^{-1}\left(q^1t, \ldots, q^nt\right)$$ where $\varphi(q) = (q^1, \ldots, q^n)$. Then $\gamma'(t) = q^i\frac{\partial}{\partial x^i}\bigg\vert_{\gamma(t)}$ for all $t \in [0, 1]$.
I will modify the definition of $\tilde{f}$ to be $\tilde{f}(q) = \int_{q_0}^q\omega$ (so the line integral starts at $q_0$, not at $p_1$ as in the original proof). Then $\tilde{f}(q) - f(q) = \int_{p_0}^{q_0}\omega$ so they differ by a constant independent of $q$.
Then $$\tilde{f}(q) = \int_\gamma\omega = \int_0^1\omega_{\gamma(t)}(\gamma'(t))dt = \int_0^1\omega_i(\gamma(t))dx^i_{\gamma(t)}\left(q^j\frac{\partial}{\partial x^j}\bigg\vert_{\gamma(t)}\right)dt$$ $$ = \int_0^1q^i\omega_i(\gamma(t))dt = \int_0^1 q^i\left(\omega_i\circ\varphi^{-1}\right)\left(q^1t, \ldots, q^nt\right)dt$$ so $\tilde{f}\circ\varphi^{-1}$ depends smoothly on the coordinates of $q$ by differentiation under the integral sign (Theorem C.14 in the book) since the integrand is smooth in the $q^i$ in $\varphi(U)$.
This shows that $\tilde{f}$ and $f$ are smooth on $U$.
Then the rest of the proof can be done as in the text.

My comments about the issue in the proof:
What the argument in the proof shows is that for every $q_0 \in U$, we have $$\frac{d}{dt}\bigg\vert_{t=0}\tilde{f} \circ \gamma(t) =
\omega_j(q_0)$$
where $\gamma(t) = \varphi^{-1}(0, \ldots, t, \ldots, 0)$ for $t \in [-\varepsilon, \varepsilon]$ and $t$ in the $j$-th position.
Intuitively, this is supposed to be a computation of the $j$-th partial derivative of $\tilde{f}$ at $q_0$, and the equality shows that it is equal to $\omega_j(q_0)$, so $\frac{\partial \tilde{f}}{\partial x^j} = \omega_j$ on $U$ for all $j$, which means $\tilde{f}$ is smooth.
But in the text, the tangent vector $\frac{\partial}{\partial x^j}\big\vert_{q_0}$ is initially only defined to act on smooth functions, and its definition in that case is $\frac{\partial}{\partial x^j}\big\vert_{q_0}\tilde{f} = \frac{\partial}{\partial x^j}\big\vert_{\varphi(q_0)}(\tilde{f} \circ \varphi^{-1})$ where $\varphi: U \to \varphi(U)$ is the smooth chart.
Also the tangent vector $\gamma'(0)$ is initially defined to act only on smooth functions, in which case the definition is $\gamma'(0)\tilde{f} = \frac{d}{dt}\big\vert_{t=0}\tilde{f} \circ \gamma(t)$.
So it appears circular to write $\frac{\partial}{\partial x^j}\big\vert_{q_0}\tilde{f} = \gamma'(0)\tilde{f} = \frac{d}{dt}\big\vert_{t=0}\tilde{f} \circ \gamma(t)$ before knowing that $\tilde{f}$ is smooth.
We can modify the definitions in the text to allow tangent vectors to act on functions that are not necessarily smooth, as long as the result is still defined. In that case the argument shows that $$\frac{\partial}{\partial x^j}\bigg\vert_{q_0}\tilde{f} \triangleq \frac{\partial}{\partial x^j}\bigg\vert_{0}(\tilde{f} \circ \varphi^{-1}) = \omega_j(q_0)\tag{1}$$ for all $q_0 \in U$ and smooth charts $\varphi$ centered at $q_0$. But now we still need to show that this implies $\tilde{f}$ is smooth.
In ordinary calculus over open subsets of $\mathbb{R}^n$ with the usual partial derivatives, we know that smoothness of partial derivatives of $f$ in a neighborhood implies smoothness of $f$.
But the text doesn't really prove an analogous result on manifolds.
We can try to prove it as follows:
The coordinate representation of $\tilde{f}$ with respect to the smooth chart $(U, \varphi)$ is $\tilde{f} \circ \varphi^{-1}$. If we can show that $\tilde{f} \circ \varphi^{-1}$ is smooth on $\varphi(U)$ then $\tilde{f}$ is smooth on $U$. The result $(1)$ above and the definition of $\frac{\partial}{\partial x^j}\big\vert_{q_0}$ shows that $\frac{\partial}{\partial x^j}\big\vert_0 (\tilde{f} \circ \varphi^{-1}) = \omega_j(q_0)$, so all partial derivatives of $\tilde{f}\circ\varphi^{-1}$ exist at $(0, \ldots, 0)$.
But for any fixed chart, this doesn't tell us anything about the partial derivatives at other points in $\varphi(U)$. The argument can actually prove that the partial derivatives exist on the coordinate axes sufficiently close to the origin, but it still doesn't cover a whole neighborhood around the origin. The problem is that we only computed $\frac{\partial}{\partial x^j}\big\vert_{q_0}\tilde{f}$ with smooth charts centered at $q_0$, so if $q$ is another point in $U$, the computation $\frac{\partial}{\partial x^j}\big\vert_q\tilde{f} = \omega_j(q)$ is not obtained relative to the same chart $(U, \varphi)$ so $\omega_i$ is not the same function for $q$ and for $q_0$.
We can try modifying the proof by considering curve segments $$\gamma(t) = \varphi^{-1}(q^1, \ldots, q^{j-1}, q^j + t, q^{j+1}, \ldots, q^n)$$ for $(q^1, \ldots, q^n) \in (-\varepsilon/2, \varepsilon/2)^n$ and $t \in [-\varepsilon/2, \varepsilon/2]$ instead. But now the curves don't pass through $p_1$ and $q_0$ so the definition of $\tilde{f}$ has to change for each choice of $(q^1, \ldots, q^n)$.
