I apologize in advance if this is somewhat elementary, but:
Let $(M,g)$ be a compact Riemannian manifold. Is there a "characterization" of which symmetric bilinear tensors $B\in Sym^2(M)$ are Hessians of functions $f\colon M\to \mathbb R$?
In other words, for which $B\in Sym^2(M)$ there exists $f\colon M\to\mathbb R$ such that $B(X,Y)=Hess \ f(X,Y)$, where $Hess\ f(X,Y)=g(\nabla_X \nabla f,Y)=X(Y(f))-\mathrm df(\nabla_X Y)$?
Obviously, since $M$ is assumed compact, any continuous function will attain a min and a max, so a symmetric bilinear form that is a candidate to Hessian cannot be definite. This maybe pretty naive, but I cannot think of any other property that distinguishes Hessians among bilinear symmetric tensors in this context... For example, it doesn't seem to be the case that $B$ has to be parallel, or satisfy any other sort of similar "nice" conditions.
Note that even if we impose the extra condition that $B$ is the Hessian of a Morse function, I don't quite see if the topology of $M$ will impose any properties on $B$ via Morse theory, since $B$ does not know if it is at a (future) critical point or not, right?