I got that doubt when I came across the following problem.
Let $f(x)=\min(\{x-1\},\{1-x\}) \enspace\forall x \in [-3,3]$, where $\{x\}$ represents the fractional part of $x$.Then which of the following is true:
- $ƒ(x)$ is a continuous function $\forall x \in [-3,3]$
- $ƒ(x)$ is a periodic function
- $\int_{-3}^3f(x)\,dx=\frac32$
- $ƒ(x)$ is an even function.
This is how solved.
Following is the graph of the function.

Now option 1),3) and 4) are correct.
But the author says that option 2) is incorrect, which leads me to a conclusion(doubt) that are function said to be periodic if and only if they are repeating in $x\in \mathbb{R}$. As it is obvious from the graph of the function that it is periodic I would like to know whether my reasoning and the author are correct?
On the one hand: A function $f$ is periodic if there is a $P$ that, for all $x$ in the domain, $f(x) = f(x+P)$. In this case $P$ looks like it should be $1$, but $f(x) = f(x+1)$ is not always true, because there if $x>2$ then $x+1$ is not also part of the domain and so $f(x+1)$ isn't even defined. Therefore, the function is not periodic.
On the other hand, it is true that there is a number $P$ that is some smallish portion of the whole domain such that $f(x) = f(x+P)$ and both $x$ and $x+P$ are in the domain, so I would say that this function is periodic within its domain, which is different from being generically periodic, so the answer to the question is still no, but this property (which has its own name) is still a thing that might be useful to have sometimes.