Hello manprash, Welcome to the forum. This function is a sinusoidal one rather than a square wave function. It will have zero average value. It is the sum of two simple sinusoids each of which individually has a zero average.
The function you have entered is not a square wave The sum of two cosine waves of the same frequency is another cosine wave of the same frequency In general the average value is 1/(b-a)∫^{b}_{a}f(x)dx You need to define the limits of the integral as that also determines the average value as much as the function itself This looks like a maths problem to me