Why do we consider potential energy function $U(x)$ differentiable? Recently when skimming through my physics-text I encountered an interesting definition of Force
$$F(x) = -\frac{\mathrm dU(x)}{\mathrm dx}$$
We were taught that some functions are continuous but not differentiable.
So for the force to exist $U(x)$ has to be differentiable. So how can we prove that $U(x)$ is differentiable everywhere?
 A: You have to think about the definition of "potential energy". Usually, we don't just pull the existence from thin air, but we deduce the existence of a potential from the properties of a conservative force. It's not hard to show that, if each line integral of a force field depends only on the start and end points of the line, there exists a differentiable function $U$ such that $F=-\nabla U$, for a proof see e.g. the Wikipedia article for conservative forces. This is the definition of a "potential energy", it is a function that belongs to a conservative force in this way.
Therefore, there is nothing to prove: Potential energies are differentiable by definition (or by the proof of their existence for conservative forces, whichever diction you prefer).
However, some potentials may carry pathological points at which they are not differentiable, for instance potentials of the form $1/r^n$, but this then results from the force already being singular at the origin. That is, if the force wasn't defined everywhere to begin with, you shouldn't expect the potential to be defined there, either. Nevertheless, everywhere where the potentials are defined, they are differentiable by construction.
A: This definition is only valid for conservative fields. Conservative fields are fields for which closed equi-potential surfaces can be defined at all points except the point sources and sinks, at times wherein the volume of the equipotentials sink to zero.
Any vector $\vec{A}$ can be written as $\vec{A}=\lambda_1\nabla f + \lambda_2\left(\nabla \times \vec{B}\right)$. A field can only be conservative if $\lambda_2=0$ since the path integral, $\int_{\vec{r_1}}^{\vec{r_2}}\vec{A} .\mathrm{d}\vec{r} = \lambda_1 \int_{\vec{r_1}}^{\vec{r_2}} \nabla f.\mathrm{d}\vec{r}+ \lambda_2 \int_{\vec{r_1}}^{\vec{r_2}}\left(\nabla \times \vec{B}\right).\mathrm{d}\vec{r}$. There is no simple way around $\lambda_2\int_{\vec{r_1}}^{\vec{r_2}}\left(\nabla \times \vec{B}\right).\mathrm{d}\vec{r}$, but if, $\lambda_2=0$, then $\int_{\vec{r_1}}^{\vec{r_2}}\vec{A}.\mathrm{d}\vec{r}=\lambda_1 \int_{\vec{r_1}}^{\vec{r_2}}\nabla f.\mathrm{d}\vec{r}= \lambda_1\int_{\vec{r_1}}^{\vec{r_2}}\mathrm{d}f=\lambda_1\left(f(\vec{r_2})-f(\vec{r_1})\right)$. Thus in the given case, $f(\vec{r})$ is the potential function for the field $\vec{A}$ provided, $\lambda_2=0$. The reason it is the potential function is that the path integral is only dependent on the initial and final position vectors of the path, namely $\vec{r_1}$ and $\vec{r_2}$. The reason $f(\vec{r})$, which is the function $U(x)$ in your case, needs to be differentiable is that other wise the field, $\vec{A}$ in my case and $F(x)$ in yours, would blow up.
I mean, the definition of potential is derived from that of conservative force fields as you see in the math above. So, first you have a conservative, well behaved, well defined, non infinite, working field, which is a real entity, then you have the potential defined for it, which is a physical/mathematical abstration. The potential is defined on that field, hence it is differentiable.
