Why must a conservative force be able to be written as a derivative of the potential function? 
*

*Why must a conservative force be able to be written as a derivative of the potential function?

*Furthermore, what exactly is a potential function?
 A: A force is conservative if $\oint_C \vec F\cdot d\vec\ell=0$, where the integral is taken around an arbitrary contour.  In words, this means you will do the same work $\int \vec F\cdot d\vec \ell$ in going from $A\to B$ irrespective of the path taken from $A\to B$, since coming back from $B\to A$ must always produce $0$ for a closed path.
By Stoke’s theorem of vector calculus, 
$$
\oint_C \vec F\cdot d\vec \ell= \int_S (\vec\nabla\times \vec F)\cdot d\vec S 
$$
so that, if the left-hand side is $0$ always, irrespective of the contour, the right-hand side must always be $0$, irrespective of the surface $S$ bounding this contour.  This in turn implies that $\vec\nabla \times \vec F$, i.e. the curl of $\vec F=0$.
If the curl of $\vec F$, i.e. $\vec\nabla\times \vec F=0$, one can then use the vector calculus identity $\vec\nabla\times (\vec \nabla v)=0$ to deduce that $F=\vec \nabla v$, i.e. that $\vec F$ is the gradient of a scalar function $v$.  From physical arguments one shows that $v=-V$, i.e. $v$ is the negative of the potential.   In this way, the work done $W =\int dV$ (in 1d) is just $- \int F dx$ as per the usual definition and is just the difference in potential between the initial and finial points.
The potential function is the energy of the system due to the interaction of its components.  Hence, a particle near the surface of the Earth, in the gravitational field of the Earth, has potential energy $V=mgh$ where $h$ is the height above some reference height (often the surface of the Earth).  If two particles are connected by (and so interact via) a spring, the potential energy is $\frac{1}{2}k(x_1-x_2)^2$ where $k$ is the spring constant.   Likewise the potential energy of an electron interacting with a proton is $-q^2/(4\pi \epsilon_0 r^2$ where $r$ is the distance between the two particles.
All of the above are conservative.  Friction is an example of a non-conservative force: obviously going from $A\to B$ along a complicated and long path will cause more energy to be dissipated by friction than if one takes the shortest possible path (assuming the coefficient of friction is constant everywhere).  Thus the work done would depend on the path, making this force by definition non-conservative.
A: *

*Firstly, potential energy is a term we only use for conservative forces. A spring can be compressed, and we know that it will jump back. This gives a sense of energy being stored until released. Thus the term potential energy has been invented.


If the spring force was not conservative, meaning that the energy added to cause the compression was just dissipated as heat or absorbed by the material, then no energy would be stored. The "spring" would stay in the new deformed shape. (Think of the difference between compressing a spring and compressing a sheet of aluminium foil.)
In other words, potential energies are only associated with conservative forces - if the force isn't conservative, then there isn't any stored energy to call potential.


*Secondly, as the next step, we must realize that the potential energy stored is exactly equal to the energy needed to fight against the conservative force.


Work must be done to fight against the spring force and compress a spring. Were there no spring force, then no work was needed to compress it. This work done is the energy that is being stored as potential energy that can be released again later.


*Thirdly and lastly, now that we have realized that potential energy $U$ equals the work $W$ done, we can simply set up the mathematical formula:
$$W=\int \vec F\; d\vec x \quad\Leftrightarrow\\
U=\int \vec F\; d\vec x\quad\Leftrightarrow\\
\vec F=\frac{dU}{d\vec x}$$

*Regarding your second question, don't think too much about the word "function". It is just a mathematical term for $U$ and makes no physical difference.
$U$ in the formula above might be different for different displacements $d\vec x$ (in a spring, the more you compress it, the more energy is stored). Since $U$ varies over values of $\vec x$, we could - if we wanted to - mathematically call $U$ a function of $\vec x$. And write it with the typical function-notation $U(\vec x)$.
The formula is no different; $U(\vec x)$ just emphasizes that the potential energy is not necessarily constant over the displacement:
$$\vec F=\frac{d\,U(\vec x)}{d\vec x}$$
A: (I will talk about vector fields in general, but you can just replace the words "vector field" with the word "force")
A vector field $\mathbf F$ is conservative if it's path independent, i.e. for any path  $\mathcal P$ connecting the points $A$ and $B$ we have 
$$\int_\mathcal{P} \mathbf F \cdot d \mathbf x = U(B)-U(A)\tag{1}\label{1}$$
In physics, $U$ is what you call the potential function. An equivalent formulation is that the integral of $\mathbf F$ over a closed path, denoted by $\oint$, is always zero:
$$\oint \mathbf F \cdot d \mathbf x = 0\tag{2}\label{2}$$
Starting from \ref{1}, it is fairly straight-forward (but a bit boring) to prove that $\mathbf F$ can be written as 
$$\mathbf F = \nabla U \tag{3}\label{3}$$
See here for a proof. Proving the converse is quicker:
$$\int_{\mathcal P} \nabla U \cdot d \mathbf x =\\
\int_A^B\nabla U (\mathbf x(t)) \cdot \mathbf x'(t) dt =\\
\int_A^B U'(\mathbf x(t)) dt = U(B)-U(A)$$
where $\mathbf x(t)$ is a parametrization of the path $\mathcal P$.
We have therefore
$$\int_\mathcal{P} \mathbf F \cdot d \mathbf x = U(B)-U(A) \iff \mathbf F = \nabla U$$
Other related results:


*

*A conservative field is irrotational (its curl is zero)
Proof 
Trivial: it follows from the vector identity
$$\nabla \times (\nabla U) = \mathbf 0 $$
valid $\forall U \in C^1$


*

*An irrotational field over a simply connected domain is conservative
Proof
It relies on Stokes' theorem.
A famous example of a vector field that is irrotational but not conservative, because its domain of definition is not simply connected, is the magnetic field of a wire (see here).
