Dexter Neutron said:
I know that average of any function is equal to sum of all the values of the function divided by number of values.
Indeed.
Dexter Neutron said:
So we can integrate sin2wt is the interval 0 to 2π and divided it by the total number of values.
But what is the total number of values.How to find it?
You correctly recalled the definition of the average of finitely many values ##a_1,\ldots,a_n## as
$$
\frac{1}{n}\sum_{i=1}^n{a_i} \qquad (1)
$$
Now, your problem is that for your function there is an infinitude of values. For such a case you need a new definition of "average". It is obtained by replacing the sum in (1) by an integral and dividing by the length of the interval. So, if ##f : \mathbb{R} \to \mathbb{R}## is a function, you can define its average over any interval ##[a,b]## as
$$
\overline{f} := \frac{1}{b-a}\int_a^b{f(x)\,dx}
$$
When the interval is unbounded, you have to use a limit. So, for your function ##f(t) := \sin^2{\omega t}## you get for its average over ##\mathbb{R}##,
$$
\overline{f} = \lim_{T \to \infty}\frac{1}{2T}\int_{-T}^T{f(t)\,dt}
$$
However, because your function is periodic with period ##\tau := \tfrac{\pi}{\omega}##, all you need to do to calculate the above is to integrate from ##0## to ##\tau## and divide by ##\tau## to obtain ##\overline{f}##. (Hint: the answer does not depend on ##\omega##.)