We already know one half of this, so it only remains to show that path independence implies existence of such an \(f\text{,}\) which is is like finding an anti-derivative for \(\vec{F}\text{.}\)
For simplicity of notation this will be done only in 2D, so \(\vec{F}(x,y) = \vector{F_1(x,y),F_2(x,y)}\text{.}\) (As usual nothing much changes in 3D.)
Taking some point \(A(a,b)\) as a "starting point", then for any suitable function \(f\)
\begin{equation*}
f(x,y) - f(a,b) = \int_A^{(x,y)} \del f \cdot d\vec{r} = \int_A^{(x,y)} \vec{F} \cdot d\vec{r}
\end{equation*}
for any path \(C\) from \(A\) to \(P(x,y)\text{.}\)
Such paths exist due to connectedness, and any such path gives the same value due to path independence.
Choosing \(f\) to have value zero at \(A\) (this is a like choosing a constant of integration), the only possibility is
\begin{equation*}
f(x,y) = \int_A^{(x,y)} \vec{F} \cdot d\vec{r}
\end{equation*}
But does this function have the correct partial derivatives?
Consider such a path that ends by coming in to point \(P\) from the left parallel to the \(x\)-axis, so the last part of the path is the straight line segment from \((c,y)\) to \((x,y)\) for some \(c \lt x\text{.}\)
Parameterizing the final straight part as \(\vec{r}(t)=(t,y)\text{,}\) \(c \leq t \leq x\text{,}\)
\begin{align*}
f(x,y)
\amp= \int_A^{(c,y)} \vec{F} \cdot d\vec{r} + \int_{(c,y)}^{(x,y)} \vec{F} \cdot d\vec{r}\\
\amp= K(y) + \int_c^x \vec{F}(t,y) \cdot \frac{d\vec{r}(t)}{dt}\, dt, \; \mbox{with } K(y)=\int_A^{(c,y)} \vec{F} \cdot d\vec{r}\\
\amp= K(y) + \int_c^x \vector{F_1(t,y),F_2(t,y)} \cdot \vector{1,0} \, dt\\
\amp= K(y) + \int_c^x F_1(t,y) \, dt
\end{align*}
Differentiating with respect to \(x\text{,}\) and using Part 1 of the Fundamental Theorem of Calculus gives
\begin{equation*}
\ds \frac{\partial f}{\partial x} = F_1(x,y)\text{.}
\end{equation*}
Similarly, \(\ds \frac{\partial f}{\partial y} = F_2(x,y)\text{,}\) so \(\del f = \vector{F_1,F_2} = \vec{F}\text{,}\) as needed.