Mathematicians love to extend the things as much as they can, and do this is a "natural" way. If you were to define the factorials for fractional numbers, what could you do ?
A first approach: when you evaluate the factorial of two consecutive integers, the factorial of the half-integer should lie somewhere in between. Due to the (super)exponential growth of the factorial, it makes sense to consider the geometric mean, and define
$$(n+\frac12)!\approx\sqrt{n!(n+1)!}=n!\sqrt{n+1}.$$
We can expect this approximation to be better and better for large $n$, and by applying $n!=n(n-1)!$ backwards, we can hope that
$$\frac{(n+\frac12)!}{(n+\frac12)(n-\frac12)...\frac32}\approx\frac{n!\sqrt{n+1}}{(n+\frac12)(n-\frac12)...\frac32}\to\frac12!$$ will converge. This is indeed the case and the limit is $\sqrt\pi/2$, and we now have
$$(n+\frac12)!=\frac{\sqrt\pi}2\frac32\frac52\dots(n+\frac12).$$
(The same method generalizes to other fractions.)
Another approach: this idea is to try an find a formula that equals $n!$ for integer $n$, but is not limited to integer arguments.
Consider the integral
$$I_n=\int_0^\infty x^ne^{-x}\ dx.$$
By parts,
$$I_n=-x^ne^{-x}\Big|_0^\infty+n\int_0^\infty x^{n-1}e^{-x}\ dx=nI_{n-1},$$and
$$I_0=\int_0^\infty e^{-x}\ dx=1,$$
so that by recurrence $I_n=n!$.
As the integral is also defined for noninteger $n$, it can serve as our extension of the factorial.
It turns out that the two definitions coincide.