Fundamental period of piecewise defined function. 
Fundamental period of the function $f(x) = \left\{\begin{matrix}
 2\;\;\;\;,x\in \mathbb{Q} \\\\ 
-2\;\;\;\;,x\notin \mathbb{Q} & 
\end{matrix}\right.$ is

As we know that function $f(x)$ is periodic function, If it satisfy the relation $f(x+T)=f(x)$
and smallest positive value of $T$ is called period of that function $f(x)$.
But here i did not understand How can i calculate period of that constant function
Help me,Thanks
 A: This function has no fundamental period. Suppose that $T$ were such a period. Then it would have to be rational, for $f(0) = F(T) = 2$. Consider $T' = T/2$. This, too, will be a period, for if $x$ is rational, so is $x + T'$, and if $x$ is irrational, so is $x + T'$. 
In fact, the numbers $T = 1, 1/2, 1/4, \ldots$ are all periods of this function, so there's no smallest positive period. 
A: There is a reason why your question has no answer.
You take $\mathbb{R}$, which is a group, and $\mathbb{Q}$, which is another subgroup.  Thus you may divide $\mathbb{R}$ in equivalence classes modulo $\mathbb{Q}$ ($\mathbb{R}/\mathbb{Q}$ is a group, but this is not the issue now).
This means that, for every rational number $r$, you will have
$$f(x+r)=f(x), \mbox{ for all }x\in \mathbb{R}.$$
Therefore, all rational numbers are periods, just by the way you defined the function.
In general, if $G$ is a group and $H$ is a subgroup, we may consider the set $G/H$ of left cosets $gH$.  Defining a function $f:G\to \mathbb{R}$ that is invariant by right translation by $H$, i.e. s.t. $f(gh)=f(g)$ for all $h\in H$,  is equivalent to defining a function $\overline{f}:G/H\to \mathbb{R}.$
Thus we may say, in a way, that the function $f$ is $H$-periodic (on the right!)  This is the case when $G$ is abelian.
A: As per definition $T$ for which $f\left(x\right)=f\left(x+T\right)$ Other than $T=0$ is called period of $f\left(x\right)$
For constant Function $f\left(x\right)=c$ ,$f\left(x\right)=f\left(x+T\right)$
For all T thus we can say that constant function is periodic but choice of T is ours 
