A scalar Lorentz invariant function satisfies
$$
f(k) = f(\Lambda k).
$$
for all $\Lambda$ satisfying $\Lambda^T \eta \Lambda = \eta$. Let us look at the infinitesimal version of this equation. Setting $\Lambda = 1 + \omega + O(\omega^2)$ into the equation above, we find the equation
$$
( k_\mu \partial_{k^\nu} - k_\nu \partial_{k^\mu} ) f(k) = 0 .
$$
To solve this differential equation, we change variables. Take,
$$
k^\mu = \left( \sqrt{ x^ix^i - z } , x^i \right) \quad \Leftrightarrow \quad z = k^2 ,~ x^i=k^i.
$$
Using this parameterization, we find
$$
\partial_{k^0} = - 2 k^0 \partial_z ,\qquad \partial_{k^i} = 2 k_i \partial_z + \partial_{x^i}
$$
It follows that
$$
k_0 \partial_{k^i} - k_i \partial_{k^0} = - k^0 [ 2 k_i \partial_z + \partial_{x^i} ] - k_i ( - 2 k^0 \partial_z ) = - k^0 \partial_{x^i}
$$
and
$$
k_i \partial_{k^j} - k_j \partial_{k^i} = x_i \partial_{x^j} - x_j \partial_{x^i} .
$$
The differential equations for $f(k) \equiv f(z,x^i)$ now takes the form
$$
- k^0 \partial_{x^i} f(z,x^i) = 0 , \qquad ( x_i \partial_{x^j} - x_j \partial_{x^i} ) f(z,x^i) = 0 .
$$
The first equation immediately implies that $f$ doesn't depend on $x^i$ so $ f \equiv f (z)=f(k^2)$.
QED.