If $f(x)=c$ then degree of $f(x)$ is $0$. (c $\neq 0$)
If $f(x)=Ax+B$ then degree of $f(x)$ is $1$. (A $\neq 0$)
If $f(x)=Ax^2+Bx+C$ then degree of $f(x)$ is $2$. (A $\neq 0$)
Now in this manner we can identify the degree of any polynomial.
But my question is if $f(x)=0$ , it means that $x^0$ has zero as its coefficient.
That is there are no $x^0$ terms in $f(x)$ .
Then what is its degree ?
For the degree of a non-zero polynomial, the following relations hold: \begin{aligned} \deg (-f) &= \deg f\\ \deg (f+g) & \le \max \{\deg f,\deg g\}\\ \deg (fg) &= \deg f+ \deg g \end{aligned} Now we want this to hold also for the degree of the zero polynomial.
Now for any polynomial, $f+(-f) = f-f=0$. Therefore according to the relations above, for any polynomial $f$: $$\deg(0) = \deg(f+(-f)) \le \max \{\deg f,\deg (-f)\} = \deg f$$
The smallest degree of a non-zero polynomial is $0$ for a constant polynomial. Therefore we get $$\deg(0) \le 0$$ On the other hand, for any polynomial, $0f=0$, therefore according to the third relation, we get for every $f$: $$\deg 0 = \deg(0f) = \deg 0 + \deg f$$ That equation is obviously not fulfilled by any integer. Indeed, not even by any real number. Therefore one possible decision is to just leave the degree of the zero polynomial undefined, as there's no number that has the required properties.
However, if you look a bit beyond the integers, there are some "numbers" that indeed fulfil that inequality: $\pm\infty$. If you add anything finite to one of them, then the result is still $\pm\infty$. Now the other requirement is that $\deg(0)\le 0$, therefore the one selection that works is $-\infty$. Therefore it is common to define $$\deg(0) = -\infty$$
Now you may be worried that computing with $-\infty$ might cause all sorts of problems. But it turns out that this is not the case, as all you ever do with it is add it either to itself, or to a natural number. Basically $-\infty$ does for addition what $0$ does for multiplication of positive numbers: It's smaller than all of them, and it forces the result to itself: If any term is $-\infty$, then so is the sum, and if any factor is $0$, so is the product. Indeed, this connection can be made more rigorous by noting that you can map addition to multiplication through the exponential function: $$\exp(x+y) = \exp(x)\exp(y)$$ The obvious definition for $\exp(-\infty)$ is $$\exp(-\infty) = \lim_{x\to-\infty}\exp(x) = 0$$ and then you get $$0 = \exp(-\infty) = \exp(-infty + x) = \exp(-\infty)\exp(x) = 0\exp(x) = 0$$ so indeed everything is consistent.
And indeed, it is not really surprising that this "additive zero" $-\infty$ appears in the degree, because like the exponential function, the degree function maps multiplication (of polynomials) to addition (of integers). Therefore the zero polynomial (which obviously acts as a $0$ under multiplication) is mapped to the "additive zero" $-\infty$.