Let $n\in \Bbb Z$ such that $n > 1$ and $n$ divides $(n-1)!+1$. Prove that $n$ is prime number.
One of the ways I can think of is to do it by contradiction:
Using the prime number definition that says that a number $n$ is prime if and only if $n>1$ and its only positive divisors are 1 and $n$.
Then I’d have to assume that $n = ab$ such that $1<a,b<n$ and would have to come to that $a = 1$ o $b = 1$.
How should I do the contradiction? Is there any easier way to do that?