Q:

Why are gravity and spring-force conservative forces?

I know that the amount of work does not depend on the followed path but on the position when speaking about conservative forces. But could someone please prove/explain why exactly those two are conservative forces?
Has it something to do with the potential energy?

A:

A conservative force has the property that the work done in moving a particle between two points is independent of the path taken. It implies that the force is dependent only on the position of the particle. Now we can use this idea to define a function called the potential energy. 
It is a conservative force that gives rise to the concept of potential energy and not the other way round. If the force were non conservative, the force would not be dependent on position only and thus we could not have defined a potential energy function.
A simpler way to find out whether a force is conservative or not is to find out the closed line integral of force, i.e $\oint dr F$ and convert it into the area integral of the curl of the force by using Green's theorem, i.e
$$ \oint  F dr = \int_A (\nabla \times F) da$$. Thus if the curl of the force is zero, it automatically means that the force is zero. It is now trivial to see that the gravitational as well as the spring force are conservative as the curl of both forces vanish.

