We generalize results on the connection between existence and uniqueness of integrals and representation theoretic properties for Hopf algebras and compact groups. For this, given a coalgebra C, we study analogues of the existence and uniqueness properties for the integral functor Hom C(C, -), which generalizes the notion of integral in a Hopf algebra. We show that the coalgebra C is co-Frobenius if and only if dim ( Hom C(C, M)) = dim (M) for all finite dimensional right (left) comodules M. As applications, we give a few new categorical characterizations of co-Frobenius, quasi-co-Frobenius (QcF) coalgebras and semiperfect coalgebras, and re-derive classical results of Lin, Larson, Sweedler and Sullivan on Hopf algebras. We show that a coalgebra is QcF if and only if the category of left (right) comodules is Frobenius, generalizing results from finite dimensional algebras, and we show that a one-sided QcF coalgebra is two-sided semiperfect. We also construct a class of examples derived from quiver coalgebras to show that the results of the paper are the best possible. Finally, we examine the case of compact groups, and note that algebraic integrals can be interpreted as certain skew-invariant measure theoretic integrals on the group.