Let $A \in \mathbb R^{n,n}$ with $QR$-decompositions $A=Q_1R_1=Q_2R_2$.
Let be A invertible. I want to show $D \in \mathbb R^{n,n} $ exists such that, $Q_1=Q_2D$ and $R_1=DR_2$ with with $d_{ii} \in \{-1,1\}, i=1,\dots,n$ .
We can conclude $R_2R_1^{-1}=Q_2^{-1}Q_1$. Furhtermore $R:=R_2R_1^{-1}$ is an upper triangle matrix and $Q:=Q_2^{-1}Q_1$ is orthogonal. Consider the eigenvalues $\lambda$ from $Q$. Then $\lambda \in \{-1,1\}$. Hence $r_{ii}\in\{1,-1\} \,\forall i=1,\dots n$.
How can we proceed to conclude $Q=R=D$?
You know that $R=Q $ is both upper triangular and orthogonal. So $Q^T=Q^{-1} $ is both lower triangular and upper triangular.