Is there a simple criterion to certify if some function $f: \mathbb{R} \to \mathbb{R}$ satisfies that $\sum_{i,j=1}^n c_ic_jf(x_i-x_j) \ge 0$ for all $x_i \in \mathbb{R}$ and $c_i \ge 0$?
Note that if $c_i \ge 0$ is relaxed to $c_i \in \mathbb{R}$, then it is equivalent via Bochner's theorem that the Fourier transform $\hat{f}$ is always non-negative.
I am asking this because I'd like to certify $\mathbb{E}[f(X-Y)]\ge 0$ for any iid rvs $X$ and $Y$. I have seen some examples of $f$ where establishing this inequality is pretty tricky. I am wondering if there is a more systematic way in proving so.