Lagrangian for a relativistic free particle can be written as
$$L=-m_0c^2\sqrt{1-\frac{v^2}{c^2}} .\tag{1}$$
It gives correct expression of Hamiltonian which is
$$H=\sqrt{p^2 c^2+m_0^2c^4}.\tag{2}$$
During a lecture today, my professor told me that Lagrangian for a free particle does not have a specific form and can be written in many ways. Then, he wrote another expression of Lagrangian that can also represent a relativistic free particle
$$L=p^{\mu}p_{\mu}+ m^2c^2.\tag{3}$$
My Questions are: What are the other forms that We can write our Lagrangian in? Does It have something to do with Lorentz invariance of the Lagrangian? How does above expression for Lagrangian can give us the correct equation of motion and Hamiltonian?