How to detect or prove that this recurrence relation defines a periodic sequence.
Here is an example $A>0$ is fixed
\begin{align} f(0) & =0 \\[10pt] f(x+1) & = \begin{cases} f(x)+1,& \text{if } A\geq f(x)\ \\ f(x)-1,& \text{if } A<f(x)\ \end{cases} \end{align}
where $A,x$ are natural numbers and the function $f$ returns a natural value.
Can you suggest any method to detect whether this type of recurrence relation defines a periodic sequence?
In fact, for $A$ integer, your sequence is 2-periodic (eventually).
As I indicated you, a drawing makes it clear that, if you suppose $A\in \mathbb{Z}$, you have two cases
in each case it is eventually periodic.
Hope it helps.