Question: Let $n \in \mathbb N$ not a prime power and not twice a prime power. Let $s \in \mathbb Z_n$ such that $s^2 \equiv 1 \pmod n$ but $s \not\equiv \pm1 \pmod n$. Is it true that always there exists a factorization $n = n_1 n_2$ with $n_1, n_2 > 1$, $(n_1,n_2)=1$, $s \equiv -1 \pmod {n_1}$ and $s \equiv 1 \pmod {n_2}$?
My partial answer: If there exist, the numbers $n_1,n_2$ satisfy $(n_1,n_2)\in\{1,2\}$. In fact, if $d \mid (n_1,n_2)$ then $d \mid s+1$ and $d \mid s-1$, so $d\in\{1,2\}$. Let $n_1=(s+1,n)$ and $n_2 = n/n_1$. If $(n_1,n_2) = 1$, then we are done. Otherwise, suppose that $(n_1,n_2)=2$ and let $n_1 = 2m_1$ and $n_2 = 2m_2$, where $(m_1,m_2)=1$. The latter implies, for example, that $4 \mid n$, $s \equiv 1 \pmod 4$, and either $m_1$ or $m_2$ is odd. Afterwards, I considered the parities of $m_1$ and $m_2$. I tried to check if the factorization $n = t_1t_2$ works, where $t_1 = (\frac{s+1}{2},n)$ and $t_2 = n/t_2$, but it will depend on other parities and I wasn't able to complete all the cases.
Can someone provide a hint that works?