<s>[INST] Solving a system of linear congruences 
Find all positive integer solutions to \begin{align*}x &\equiv -1 \pmod{n} \\ x&\equiv 1 \pmod{n-1}. \end{align*}

I rewrote the system as $x = nk_1-1$ and $x = (n-1)k_2+1$. Thus, we have $nk_1-1 = (n-1)k_2+1$ and so $n(k_1-k_2) = 2-k_2 \implies n = \frac{2-k_2}{k_1-k_2}$. How do I solve it from here?
 [/INST] As $n,n-1$ are relatively prime the Chinese Remainder Theorem guarantees a unique solution $\pmod {n(n-1)}$ .  Indeed we have, $$x\equiv 2n-1 \pmod {n(n-1)}$$
To see this, solve the first congruence to get $x=-1+mn$.  Substituting that into the second gives $$-1+mn\equiv 1 \pmod {n-1}\implies mn\equiv 2 \pmod {n-1}\implies m\equiv 2 \pmod {n-1}$$
And we are done.
</s>