I am learning about definite integrals and found the formula for finding an average of a function over a given interval:
$$\frac{1}{b-a} \int_{a}^{b} f\left(x\right) dx$$
If we look at the average function for a set of numbers: $$\frac{1}{n} \sum_{i=1}^{n} x_i$$
It would seem as if the integral is essentially a summation of all values from $a$ to $b$. Is it correct to think of it this way?
It's certainly helpful to think of integrals this way, though not strictly correct. An integral takes all the little slivers of area beneath a curve and sums them up into a bigger area - though there's, of course, a lot of technicality needed to think about it this way.
There is an idea being obscured by your idea of an integral as a sum, however. In truth, a sum is a kind of integral and not vice versa - this is somewhat counterintuitive given that sums are much more familiar objects than integrals, but there's an elegant theory known as Lebesgue integration which basically makes the integral a tool which eats two pieces of information:
We start with some indexing set and some way to "weigh" pieces of that set.
We have some function on that set.
Then, the Lebesgue integral spits out the weighted "sum" of that function.
An integral in the most common sense arises when you say, "I have a function on the real numbers, and I want an interval to have weight equal to its length." A finite sum arises when you say "I have a function taking values $x_1,\ldots,x_n$ on the index set $\{1,\ldots,n\}$. Each index gets weight $1$" - and, of course, you can change those weights to get a weighted sum or you can extend the indexing set to every natural number to get an infinite sum. But, the basic thing to note is that there's a more general idea of integral that places summation as part of the theory of integration.