How to show the velocity of free motion is constant in Galileo's relativity principle? Picture below is from Landau & Lifshitz's Mechanics.  How to get the red line from green line?



 A: Quite generally, the Langrangian of a single particle in three spatial dimensions can be a function of the variables time $t$, position $\mathbf{r}$ and velocity $\mathbf{v}= \dot{\mathbf{r}}$.
In the special case of an inertial frame, no instant of time, no point in space and no direction in space is preferred with respect to another one. This property is meant by saying that an inertial frame can be characterized by homogeneity of time and space and isotropy of space. As a consequence, the Lagrangian of a free point particle in an inertial frame must be independent of $t$ (homogeneity of time) and $\mathbf{r}$ (homegeneity of space). Remains a dependence on the velocity $\mathbf{v}$. But as there is no preferred direction in space, the Lagrangian can only depend on $\mathbf{v} \cdot \mathbf{v}$, leading to $L= L(\mathbf{v}^2)$ (c.f. eq. (3.1) in the book of Landau-Lifshitz). In that case, the Euler-Lagrange equations reduce to $$\frac{d}{dt} \frac{\partial L(\mathbf{v}^2)}{\partial v_i} = 0 \quad \Rightarrow \quad \frac{\partial L(\mathbf{v}^2)}{\partial v_i}= {\rm const.} \quad {\rm for} \, \,   i=1,2,3. $$ Employing the chain rule, one obtains $$\frac{\partial L(\mathbf{v}^2)}{\partial v_i} =L^\prime(\mathbf{v}^2) \, \frac{\partial \mathbf{v}^2}{\partial v_i} = 2 L^\prime(\mathbf{v}^2) v_i,$$  as $\partial \mathbf{v}^2 /\partial v_i = \partial (v_k v_k) / \partial v_i = 2 v_i$.
Thus, the Euler-Lagrange equations lead to $L^\prime(\mathbf{v}^2) v_i = {\rm const.}$ for $i=1,2,3$ and finally to the desired result $\mathbf{v} ={\rm const.}$ (c.f. eq. (3.2) in the book).
Note that the form of the function $L(\mathbf{v}^2)$ is not yet determined by homogeneity of space and time and isotropy of space alone. This demands the additional requirement  that the action integral should be invariant under a velocity transformation (Galilei transformation in the nonrelativistic limit and Lorentz transformation in the general relativistic case, respectively). In the nonrelativistic (NR) case, this additional requirement leads to $L_{\rm NR}(\mathbf{v}^2) = a \mathbf{v}^2$ with the constant of proportionality denoted by $a= m/2$. In the general (relativistic) case, the Lagrangian is given by $L(\mathbf{v}^2)= -m c^2 \sqrt{1- \mathbf{v}^2/c^2}$, which reduces indeed to $L(\mathbf{v}^2) = -m c^2 + m \mathbf{v}^2/2$ in the nonrelativistic limit $|\mathbf{v}| <\!\!< c$. (The constant term $-mc^2$ does not affect the equations of motion.)
Edit: In view of the comment below, let me demonstrate the step from $\frac{d}{dt} \left( L^\prime (\mathbf{v}^2) v_i\right) =0$ (for $i=1,2,3$) to $d \mathbf{v}/dt=0$ in full detail. As $$ 0= \frac{d}{dt} \left( L^\prime (\mathbf{v}^2) v_i \right) = 2 L^{\prime \prime}(\mathbf{v}^2)\, \mathbf{v}\!\cdot \!\dot{\mathbf{v}} \, v_i + L^\prime (\mathbf{v}^2) \dot{v}_i = \left( 2 L^{\prime \prime} (\mathbf{v}^2) v_i v_j +L^\prime (\mathbf{v}^2) \delta_{i j} \right) \dot{v}_j $$ (summation convention used in the last step), this equation implies $\dot{\mathbf{v}}=0$ if we can show that the determinant of $M_{ij}= 2 L^{\prime \prime}(\mathbf{v}^2) v_i v_j + L^\prime(\mathbf{v}^2) \delta_{ij}$ does not vanish. As the determinant is given by $$\det M = \left(2 L^{\prime\prime}(\mathbf{v}^2) \mathbf{v}^2 + L^\prime(\mathbf{v}^2) \right) \left(L^\prime(\mathbf{v}^2)\right)^2,$$ we have to rule out the cases $L^\prime (\mathbf{v}^2) =0$ and $2 L^{\prime \prime}(\mathbf{v}^2) \mathbf{v}^2 +L^\prime(\mathbf{v}^2)=0$. $L^\prime (u)=0$ (with $u=\mathbf{v}^2$) implies $L(u) = C$ with a constant $C$, which does not represent a physically acceptable Lagrangian. The differential equation $2 L^{\prime \prime}(u) u + L^\prime (u)=0$ has the solution $L(u) = a u^{1/2} +b$ with constants $a,b$, corresponding to the Lagrangian $L(\mathbf{v}^2) = a |\mathbf{v}|+b$ with the equation of motion $\frac{d}{dt} (\mathbf{v}/|\mathbf{v}|)=0$. This Lagrangian can be ruled out as it does not admit a Galilei (Lorentz) invariant action integral.
A: If $$f(v(t))=\text{constant}$$ in time, then either $f$ is constant for all the velocities that the the particle has during it's motion, or or the velocity itself is constant in time, because if the velocity changes
$$v(t_1)\ne v(t_2)$$ then
$$f(v(t_1))\ne f(v(t_2))$$
I guess Laundau here just assumes that the gradient of the Lagrangian with respect to velocity is non-trivial (non constant), so hat we must be in the second case.
A: $\def \b {\mathbf}$
Another solution
From EL you obtain
$$\frac{d}{dt}\left(\frac{\partial L}{\partial \b v}\right)^T=\underbrace{\frac{\partial}{\partial \b v}\left(\frac{\partial L}{\partial \b v}\right)^T}_{\ne 0~(\text{if}~L=L(\b v^2))}\frac{d \b v}{dt}=0\quad\Rightarrow\\
 \frac{d\b v}{dt}=0\quad ,\b v=\text{constant}~\surd$$
Notice
$$\left(\frac{\partial L}{\partial \b v}\right)^T\bigg|_{~\b v\mapsto \b v(t)}=\text{constant}$$
thus the factor of $~\frac{d\b v}{dt}~$ is the mass matrix $\left(~\b M\,\frac{d\b v}{dt}\right)=\b 0$

Example
$$L=-m\,c^2\,\sqrt{1-\frac{\b v^2}{c^2}}$$
$$\b M=\frac{m\,c^3}{(c^2-\b v^2)^{3/2}}$$
