The foundational aspects of Gauss's work on the hypergeometric, factorial and digamma functions