How do i know when i let $x'(0)=0$,x(t) must have the largest or smallest value,For example,let $x(t)=at^2+bt+c$,when we differential it with t and set the differential formula be equal to zero,and we can know when t is equal to some value,the x(t) will have the smallest or largest value,in this simple example,we can just substitute t value with some value and back into the x(t) to know the wheather the x(t) have the largest or smallest,but if in this competitive formula,$\mathcal L(s,m,\alpha,\lambda,v,\mu,\xi)=\lambda_kR_{1,k}+(1-\lambda_ k)R_{2,k}-\mu \alpha_k-\xi s_k-v_km _k+\sum \limits_{i=k+1}^{K}\eta v_i(g_{r,i}s_k+g_{k,i}m_k) $
,and differential $s_k$ and set to be zero,how do i know the $\mathcal L(s,m,\alpha,\lambda,v,\mu,\xi)$ will have the largest or smallest value when i substitute the $s_k$ value back into this formula?
The key point is something often called Fermat's theorem, and its higher-ordered analogues. They all read something like "If the function is differentiable at a point and if that point is a local extremum then the derivative-like-thing at that point is $0$."
Since the only possible locations for global extrema are the boundary and at the locations of the local extrema, one may then perform a search for the global extrema by considering all of the following locations:
As a practical matter, that set of points is often small and easily searched. In the first problem you gave, the boundary of the space you are considering is just $\pm\infty$, the derivative is $0$ in only one location, and the derivative exists everywhere. By searching just those three locations, any global extrema can be found.
For equations with more variables (like the second equation you listed) the same kind of property holds, but the search space is often no longer finite in cardinality. Finding the extrema in such problems can be an arduous task, but the search space described in (1-3) is still usually much smaller than the entire space.