I have read something about Wilson's theorem, but I found that $$(n-1)!\ \equiv\ -1 \pmod n$$ I thought, that $-1\equiv 1\pmod x$, but in all literature, I only found upper theorem.
My reason why I am asking this is that $-1$ gives the same remainder as $1$ when dividing with some number. (Remainder can't be negative.)
Example: $$-1\div5=0 \text{ (remainder = 1)}$$ $$1\div 5=0\text{ (remainder = 1)}$$
Question: Is it true, that $-1\equiv 1 \pmod x$?
Thank you in advance!
P.S.
We can rewrite the title of the question into "Why is true $(n-1)!\ \equiv\ -1 \pmod n$ and not $(n-1)!\ \equiv\ 1 \pmod n$?"
The only $x$s for which $1$ and $-1$ are congruent are $1$, $-1$, $2$, and $-2$.
There are two standard ways of defining the congruence. The most common one you do not seem to be using:
Definition. Let $n$ be an integer. We say that integers $a$ and $b$ are congruent modulo $n$, written $a\equiv b\pmod{n}$, if and only if $n$ divides $a-b$.
Here you see that $-1\equiv 1\pmod{x}$ holds if and only if $x$ divides $-2$, which is only possible if $x=\pm 1$ or $x=\pm 2$.
Alternatively, one uses division with remainder.
Division algorithm. Let $b$ be a nonzero integer, and let $a$ be any integer. Then there exist unique integers $q$ and $r$ such that $a=bq+r$, and $0\leq r \lt |b|$. If $q$ and $r$ are such integers, $q$ is called the quotient of dividing $a$ by $b$, and $r$ is the remainder when dividing $a$ by $b$.
With those definitions, we have the following theorem, which may also be used as a definition of congruence modulo nonzero $n$:
Theorem. Let $n$ be a nonzero integer. Then $a$ and $b$ are congruent modulo $n$ if and only if $a$ and $b$ have the same remainder when divided by $n$.
Proof. Write $a=q_1n+r_1$, $b=q_2n+r_2$, with $0\leq r_1\lt |n|$, and $0\leq r_2\lt |n|$. Without loss of generality, say $r_1\geq r_2$. Then $a-b = (q_1-q_2)n+(r_1-r_2)$, and $0\leq r_1-r_2\leq r_1\lt |n|$, so the remainder when dividing $a-b$ by $n$ is $r_1-r_2$.
Thus, $a\equiv b\pmod{n}$ if and only if $n$ divides $a-b$, if and only if $r_1-r_2=0$, if and only if $r_1=r_2$, if and only if the remainders when dividing $a$ by $n$ and when dividing $b$ by $n$ are equal. $\Box$
The problem is that you have to be careful with negative numbers: if you divide $-1$ by $3$, the quotient is not $0$: the quotient is $-1$ with a remainder of $2$, since $-1=(-1)3 + 2$. If you divide $-1$ by $5$, the quotient is $-1$ with remainder $4$.
(And in any case if you divide $-1$ by $5$, it is certainly not true that the quotient is $0$ and the remainder is $1$, because that would mean that $-1 = 0(5)+1$, which is certainly false!)