Estimating the second derivative of function from optimizers
The first order condition of the maximization problem is
\begin{equation}
f'(x)-s=0\iff f'(x)=s
\end{equation}

We can then replace $x$ by $x(s)$ because this is the optimal value given $s$. Since this is true for every $s$, we can differentiate with respect to $s$ which yields 
\begin{equation}
f''(x(s))x'(s)=1
\end{equation}

Which can be rewrite as 
\begin{equation}
f''(x(s))=\frac{1}{x'(s)}
\end{equation}

Then $x'(s)$ can be estimated by finite differences which would give $f''(x)$.