The question is to prove the following:
If $n>4$ is composite, then $(n-1)! \equiv 0 \pmod n$
My attempt to prove so is the following:
Since $n$ is not prime, the prime factors of $n$ lies in $(n-1)!$ yielding a term of $kn$ for some integer $k$. Hence, it is divisible by $n$ as desired.
The proof seems too short, did I prove it correctly?
Suppose first that $n=p^k$ for some odd prime $p$ and positive integer $k\ge 2$. Then you see that $p^{k-1},\dots,(p-1) p^{k-1}$ all contribute with a factor $p^{k-1}$ to the power of $p$ dividing $(p^k-1)!$. Then $(p-1)(k-1)\ge k$ because $k\ge 2\ge (p-1)/(p-2)$. So $p^k$ divides $(p^k-1)!$.
If $n=2^k$, with $k\ge 3$, then every even number between $1$ and $2^k-1$ contributes with at least a factor $2$ and $4<2^k-1$ contributes with an additional factor $2$. Therefore the exponent of the power of $2$ dividing $(2^k-1)!$ is at least $2^{k-1}+1\ge k$. So $2^k$ divides $(2^k-1)!$.
Finally, if $n$ has at least two different prime factors, and $p^k$ is the highest power of $p$ dividing $n$, then $p^k\le n-1$, so the claim is trivial in this case.