Is there an easy way of seeing that a function is a positive-definite kernel? Let $\mathcal{X}$ be a nonempty set. A symmetric function $K: \mathcal{X} \times \mathcal{X} \rightarrow \mathbb{R}$ is called a positive-definite (p.d.) kernel on $\mathcal{X}$ if
\begin{equation*}
\sum_{i=1}^{n} \sum_{j=1}^{n} c_{i} c_{j} K\left(x_{i}, x_{j}\right) \geq 0
\end{equation*}
holds for any $x_{1}, \ldots, x_{n} \in \mathcal{X}$, given $n \in \mathbb{N}, c_{1}, \ldots, c_{n} \in \mathbb{R}$.
I would like to know when is the following function a p.d. kernel on $\mathcal{X} = [0,1]$
$$f(s, t)=s g(t)+t g(s)-s t g(1)+ \min (s,t)(1-\max(s,t)),$$
i.e, what conditions should $g$ satisfy for $f$ to be p.d.?
For instance, if we fix $g(x)=x^2$, how does one check if $f$ is p.d. or not p.d.?
I believe that $\min (s,t)(1-\max(s,t))$ is itself a p.d. kernel (although I am not sure how to show it), does that help to show that $f$ is p.d.?
 A: Not an answer. Too long for a comment, but some algebraic work.
In the case of $g(x)=x^2,$ then:
$$h(s,t)=sg(t)+tg(s)-stg(1)=s^2t^2-(s-s^2)(t-t^2)$$
So given $x=(x_i), c=(c_i),$ we have
$$\sum_{i,j}c_ic_jh(x_i,x_j)=\sum_{i,j} c_i c_j x_i^2x_j^2-\sum_{i,j} c_ic_j (x_i-x_i^2)(x_j-x_j^2)\\=(c\cdot y)^2-(c\cdot z)^2$$ where $y=(y_i)=(x_i^2),$  and $z=(z_i)=(x_i(1-x_i))=x-y.$
This works for more general $g$ with $g(1)=1,$ and can be made to work when $g(1)\neq 0,$ getting:
$$h(s,t)=\frac{g(s)g(t)-(sg(1)-g(s))(tg(1)-g(t))}{g(1)}$$
So again you get the double sum is $$\frac1{g(1)}\left((c\cdot y)^2-(c\cdot z)^2\right)$$ where $y=(g(x_i))$ and $z=g(1)x-y).$
This can be written, using the difference of squares, as: $$(c\cdot x)(c\cdot (2y-g(1)x))$$
Not sure if that helps any.
So for just this component to be positive definite, you’d need $\sum c_ix_i$ to have the same sign as $\sum c_i(2g(x_i)-x_i).$
At minimum, this means $\sum c_ix_i$ has the same sign as $\sum c_ig(x_i).$ That’s a weaker condition, but I think it is enough to ensure that $g(x)=\lambda x$ for some $\lambda>0.$
If so, the left half, without the minimums, cannot be positive definition.
But I haven’t quite got that proof, so it might not be true. My intuition is telling me the graph of $g$ has to be a line, but maybe not through $(0,0).$
