According to my textbook ,
Function should be continuous only at one point and to be defined everywhere.
For example ,
$$F(x)=\begin{cases} x\ \text{if} \ x\in Q \\-x\ \text{if} \ x\notin Q \end{cases}$$
The above example is continuous at $x = 0$ and defined everywhere.
My question is what does this means to be defined everywhere and how a function can be continuous at one point?
Let's look at definition of continuity using neighborhood conception (John M.H. Olmsted - Advanced calculus-Prentice Hall (1961), case for single variable on page 43, multiple - page 186 ):
$f$ is continuous at some point $a$ iif $f$ is defined in $a$ and holds $\varepsilon-\delta$ definition for points from $a$'s neighborhood in which function is defined. I.e. definition puts restriction on intersection of domain of $f$ and $a$'s neighborhood.
Using such definition continuity for function can be defined, together with definition in limit point of domain, also in isolated point of domain - in such cases function is automatically continuous and we can say, that it is continuous at single point.
Addition.
How it became known from the comments. We are talking about the book AMIT M Agarwal - A Textbook of Differential Calculus, Chapter 6, page 470. Under the title "Function continuous only at one point and defined everywhere. (Single Point Continuity)". eg,(ii) is function brought in OP.