Let me review an argument given in the most textbooks. First let's start by formulating postulates of special relativity.
Postulate 1 "The laws of nature and the results of all experiments performed in a given frame of reference are independent of the translational motion of the system as a whole. More precisely, there exists a triply infinite set of equivalent Euclidean reference frames moving with constant velocities in rectilinear paths relative to one another in which all physical phenomena occur in the identical manner" (taken from 11.1 p. 517 Classical Electrodynamics 3rd ed)
We will use the following consequence of this postulate:
If two distinct object are observed to be moving with the same velocity $\vec v$ in an inertial reference frame $K$, then those two objects will also be observed to be moving with the same velocity $\vec v'$ in any other reference frame $K'$.
As a direct consequence of this observation we will conclude that any coordinate transformation between $K$ and $K'$ has to be an affine map. Indeed an object moving at constant speed follows a line and any other object with the same speed follows a parallel line. But a coordinate transformation that carries straight lines into straight lines and preserves parallelism, has to be affine, by this non obvious fact. Let $X=(x,y,z,t)$ ($X'=(x',y',z',t')$) be the coordinates of an event $E$ in $K$ (resp. in $K'$). The transformation between $K$ and $K'$ will be denoted by $L$, and $X'=LX$.
Now let's formulate the second postulate:
Postulate 2 "The speed of light in the vacuum is the same and is isotropic with respect any inertial frame, regardless the motion of the source."(taken from 1.3 "From Special Relativity to Feynman Diagrams")
We will prove now the following fact:
Fact Let $\eta=diag(1,1,1,-1)$ and let $S$ be a symmetric real matrix. If $X^T\eta X=0$ implies $X^T S X=0$, then there is a constant $\lambda$ such that $X^T S X= \lambda X^T\eta X$, for all $X$.
Proof : Take $X=(1,0,0, \pm 1)$, then $S_{11}+S_{00} \pm 2S_{01}=0$. It follows $S_{11}=-S_{00}$ and $S_{01}=0$. Similarly we get $S_{22}=S_{33}=-S_{00}$ and $S_{02}=S_{03}=0$. Now take $X=(1,1,0, \sqrt 2)$, then $0=S_{11}+S_{22}+2S_{00}+2S_{12}$, it follows $S_{12}=0$. Similarly $S_{23}=S_{13}=0$. Let $\lambda=-S_{00}$, the conclusion follows.
The argument presented here follows 1.3 "From Special Relativity to Feynman Diagrams". Without loss of generality we may assume that $K'$ moves away from $K$ with speed $V$ in the $x$-direction and we have the two origins $O$ and $O'$ coincide at $t=t'=0$. In this case $L$ is linear.
Observe that the planes $xz$ and $x'z'$ coincide at all times. Then $y=0$ implies $y'=0$. But $L$ is linear so $y'= ax +by+cz +dt$, it follows $y'=by$. We can regard $b$ as a function of $V$, $b=b(V)$. Now if we change the orientation of the $x'$-axis and of the $x$-axis, then the equation for $y'$ and $y$ reads, $y'=b(-V)y$. Then $b(-V)=b(V)$. But $K$ moves with speed $-V$ with respect to $K'$, therefore $y=b(-V)y'$. It follows that $y=b(-V)y'=b(V)y'=b(V)^2y$, then $b(V)=\pm 1$. But the axes $y$ and $y'$ are oriented in the same direction so $y'=y$. Similarly we get $z'=z$.
For the observer in $K$ the equation of motion the plane $y'z'$ is $x=Vt$, but for the observer in $K'$ it is $x'=0$. However $L$ is linear so we may write $x'= ax +by+cz +dt$, for some $a$, $b$, $c$, and $d$. Then it follows that $aV+d=0$, so $x'=a(x-Vt)$. Therefore $xt$ transforms linearly into $x't'$.
We are ready now to apply Postulate 2 in order to deduce the invariance of the interval. Assume that at $t=t'=0$ a light source emits a signal from $O=O'$. The signal propagates isotropically in all the directions with the speed of light $c$. In $K$ an observer sees a spherical wave-front with radius $r=ct$, similarly in $K'$ a spherical wave-front of radius $r'=ct'$ is observed. Now to simplify the relations we choose units in which $c=1$. For the observer in $K$, the equation of wave-front reads: $X^T \eta X = x^2+y^2+z^2-t^2=0$, similarly in $K'$: $0=X'^T \eta X'=X^T L^T\eta L X$. Let $S=L^T\eta L$. By the Fact proven above, there is a constant $\lambda$ such that $X'^T \eta X'=X^T S X =\lambda X^T\eta X$. By comparing the coefficient in $y^2$ on both sides of the equation $X'^T \eta X'=\lambda X^T\eta X$, we deduce that $\lambda =1$. This proves the invariance of the interval.