Let two inertial systems $\;\mathrm S_1,\mathrm S_2\;$ with common axis $\;x_1\equiv x_2\;$ and parallel axes $\;y_1\parallel y_2\;$ and $\;z_1\parallel z_2$. The system $\;\mathrm S_2\;$ is moving along the common axis $\;x_1\equiv x_2\;$ with constant velocity vector $\;\boldsymbol{\upsilon}\;$ as in Figure. For the space-time intervals
\begin{equation}
\mathrm ds^2_1 \boldsymbol{=}\mathrm dt^2_1\!\boldsymbol{-}\!\mathrm dx^2_1\!\boldsymbol{-}\!\mathrm dy^2_1\!\boldsymbol{-}\!\mathrm dz^2_1\,, \quad \mathrm ds^2_2 \boldsymbol{=}\mathrm dt^2_2\!\boldsymbol{-}\!\mathrm dx^2_2\!\boldsymbol{-}\!\mathrm dy^2_2\!\boldsymbol{-}\!\mathrm dz^2_2
\tag{01}\label{eq01}
\end{equation}
we have
\begin{equation}
\mathrm ds^2_2 \boldsymbol{=}\phi\left(\boldsymbol{\upsilon}\right)\mathrm ds^2_1
\tag{02}\label{eq02}
\end{equation}
where $\;\phi\left(\boldsymbol{\upsilon}\right)\;$ a function of the vector variable $\;\boldsymbol{\upsilon}\;$ to be determined.
Now, suppose a third system $\;\mathrm S_3\;$ at rest with respect to $\;\mathrm S_2\;$ with common axis $\;y_2\equiv y_3\;$ and anti-parallel axes $\;x_3\parallel \boldsymbol{-} x_2\;$ and $\;z_3\parallel \boldsymbol{-} z_2\;$. Then
\begin{equation}
\mathrm ds^2_3 \boldsymbol{=}\mathrm ds^2_2 \stackrel{\eqref{eq02}}{\boldsymbol{=\!=}}\phi\left(\boldsymbol{\upsilon}\right)\mathrm ds^2_1
\tag{03}\label{eq03}
\end{equation}
Also let a fourth system $\;\mathrm S_4\;$ at rest with respect to $\;\mathrm S_1\;$
with common axis $\;y_4\equiv y_1\;$ and anti-parallel axes $\;x_4\parallel \boldsymbol{-} x_1\;$ and $\;z_4\parallel \boldsymbol{-} z_1\;$. Then the system $\;\mathrm S_4\;$ is moving with respect to $\;\mathrm S_3\;$ with the constant velocity vector $\;\boldsymbol{\upsilon}\;$ along the common axis $\;x_3\equiv x_4$. The configuration of systems $\;\mathrm S_3,\mathrm S_4\;$ is in all respects identical to that of the $\;\mathrm S_1,\mathrm S_2\;$ (this is more clear viewing the Figure from its back). So
\begin{equation}
\mathrm ds^2_4 \boldsymbol{=}\phi\left(\boldsymbol{\upsilon}\right)\mathrm ds^2_3\stackrel{\eqref{eq03}}{\boldsymbol{=\!=}}\phi^2\left(\boldsymbol{\upsilon}\right)\mathrm ds^2_1
\tag{04}\label{eq04}
\end{equation}
Now the system $\;\mathrm S_1\;$ is at rest with respect to $\;\mathrm S_4\;$ so
\begin{equation}
\mathrm ds^2_1\boldsymbol{=}\mathrm ds^2_4\stackrel{\eqref{eq04}}{\boldsymbol{=\!=}}\phi^2\left(\boldsymbol{\upsilon}\right)\mathrm ds^2_1
\tag{05}\label{eq05}
\end{equation}
that is we must have
\begin{equation}
\phi^2\left(\boldsymbol{\upsilon}\right)\boldsymbol{=}1
\tag{06}\label{eq06}
\end{equation}
or
\begin{equation}
\phi\left(\boldsymbol{\upsilon}\right)\boldsymbol{=\pm}1
\tag{07}\label{eq07}
\end{equation}
But for $\;\boldsymbol{\upsilon=0}\;$ the systems $\;\mathrm S_1,\mathrm S_2\;$ are identical, so in \eqref{eq02} we must have $\;\mathrm ds^2_2 \boldsymbol{=}\mathrm ds^2_1\;$, that is $\;\phi\left(\boldsymbol{0}\right)\boldsymbol{=+}1\;$ and \eqref{eq07} yields
\begin{equation}
\phi\left(\boldsymbol{\upsilon}\right)\boldsymbol{=+}1\,, \quad \text{for any } \boldsymbol{\upsilon}
\tag{08}\label{eq08}
\end{equation}