I am currently working on plotting a function and figuring out if its periodic or not. The function is as follows:$$x_n=\beta\cdot x_{n-1}+\alpha\gamma\cdot\operatorname{sgn}(x_{n-3})+\alpha(1-\gamma)\cdot\operatorname{sgn}(x_{n-2})$$ I know $0<\beta<1$, $\alpha<0$, $0<\gamma<1$. Note that $\operatorname{sgn}$ is the sign function.
I have created an app on MATLAB which helps me figure out if it is periodic or not depending on the three initial values I start with. I have noticed that it can be $1$, $3$ or $4$-periodic so far.
I am having a hard time figuring out how to write this mathematically. I am trying to find a negative delay. Any hints or sources that I can use would be really appreciated.



$\DeclareMathOperator{\sgn}{sgn}$In this answer it is always assumed that $0 < β, γ < 1$ and $α \in \mathbb{R}^*$.
Define $ε_n = \sgn(x_n)$ for $n \geqslant 1$, then the recurrence relation becomes$$ x_n = βx_{n - 1} + α(1 - γ) ε_{n - 2} + αγ ε_{n - 3} $$ and it can be proved by induction that$$ x_n = β^{n - 3} x_3 + α(1 - γ) \sum_{k = 2}^{n - 2} β^{n - k - 2} ε_k + αγ \sum_{k = 1}^{n - 3} β^{n - k - 3} ε_k. \quad \forall n \geqslant 3 $$ Next assume that $N$ is a period of the sequence $\{x_n\}$, then\begin{gather*} x_3 = x_{N + 3} = β^N x_3 + α(1 - γ) \sum_{k = 2}^{N + 1} β^{N - k + 1} ε_k + αγ \sum_{k = 1}^N β^{N - k} ε_k\\ \Longleftrightarrow x_3 = \frac{α}{1 - β^N} \left( (1 - γ) \sum_{k = 2}^{N + 1} β^{N - k + 1} ε_k + γ \sum_{k = 1}^N β^{N - k} ε_k \right), \end{gather*} where $ε_{N + 1} = ε_1$. For general $m \geqslant 0$, define $x'_n = x_{n + m}$ and $ε'_n = ε_{n + m}$ for $n \geqslant 1$, analogous derivation shows that$$ x_{m + 3} = x'_3 = \frac{α}{1 - β^N} \left( (1 - γ) \sum_{k = 2}^{N + 1} β^{N - k + 1} ε'_k + γ \sum_{k = 1}^N β^{N - k} ε'_k \right), $$ i.e.$$ x_n = \frac{α}{1 - β^N} \left( (1 - γ) \sum_{k = 2}^{N + 1} β^{N - k + 1} ε_{n + k - 3} + γ \sum_{k = 1}^N β^{N - k} ε_{n + k - 3} \right), \quad \forall n \geqslant 3 \tag{1} $$ where $ε_{N + k} = ε_k$ for $k \geqslant 1$.
Remark: (1) implies that if $N'$ is a period of $\{ε_n\}$, it is also a period of $\{x_n\}$.
Therefore, on the one hand, sequence $\{x_n\}$ can be completely recovered by $ε_1, \cdots, ε_N$. On the other hand, for arbitrary $N \geqslant 1$ and $ε_1, \cdots, ε_N \in \{-1, 0, 1\}$, it suffices to check whether $ε_n = \sgn(x_n)$ holds for $1 \leqslant n \leqslant N$, where $x_1 = x_{N + 1}$, $x_2 = x_{N + 2}$, and $x_n$ ($n \geqslant 3$) is given by (1) .
Now consider the case in which $ε_n ≠ 0$ for any $n \geqslant 1$. For $n \geqslant 3$, since $ε_{N + n - 2} = ε_{n - 2}$, then by (1), $ε_n = \sgn(x_n)$ is equivalent to$$ ε_n = \sgn(α) · \sgn\left( ((1 - γ) + β^{N - 1} γ) ε_{n - 2} + ((1 - γ)β + γ) \sum_{k = 2}^N β^{N - k} ε_{n + k - 3} \right). \tag{2} $$ Note that $(1 - γ) + β^{N - 1} γ > 0$, $(1 - γ)β + γ > 0$, and$$ (1 - γ) + β^{N - 1} γ > ((1 - γ)β + γ) \sum_{k = 2}^N β^{N - k} \Longleftrightarrow γ < \frac{1 - 2β + β^N}{2(1 - β)(1 - β^{N - 1})}. $$ If $γ < \dfrac{1 - 2β + β^N}{2(1 - β)(1 - β^{N - 1})}$, or in particular $β < \dfrac{1}{2}$ and $γ \leqslant \dfrac{1 - 2β}{2(1 - β)}$, then (2) is equivalent to$$ ε_n = \sgn(α) · ε_{n - 2}. \tag{3} $$
To simplify the discussion below, define shift operator $s_m$ for $m \geqslant 1$ and reversion operator $r$ as $s_m(x)_n = x_{n + m}$ and $r(x)_n = -x_n$ for all $n \geqslant 1$.
Case 1.1: $α > 0$. Now (3) becomes $ε_n = ε_{n - 2}$ for all $n \geqslant 3$.
Case 1.2: $α < 0$. Now (3) becomes $ε_n = -ε_{n - 2}$ for all $n \geqslant 3$. Note that all the four possibilities of $(ε_1, ε_2)$ can be generated by the case in which $(ε_1, ε_2) = (1, 1)$ with shift operators and reversion operators. Thus it suffices to consider the case in which $(ε_1, ε_2) = (1, 1)$, then for all $n \geqslant 1$,$$ x_{4n - 3} = -x_{4n - 1} = -\frac{α}{1 + β^2} (1 - β - 2γ),\\ x_{4n - 2} = -x_{4n} = -\frac{α}{1 + β^2} (1 + β - 2βγ). $$
Analogously, by singling out $ε_{n - 3}$ instead of $ε_{n - 2}$ in (2), it can be proved that if $γ > \dfrac{1 - 2β + 2β^2 - β^N}{2(1 - β)^2}$, or in particular $β < \dfrac{1}{2}$ and $γ \geqslant \dfrac{1 - 2β + 2β^2}{2(1 - β)^2}$, then (2) is equivalent to$$ ε_n = \sgn(α) · ε_{n - 3}. \tag{4} $$
Case 2.1: $α > 0$. Now (4) becomes $ε_n = ε_{n - 3}$ for all $n \geqslant 4$. In the eight possibilities of $(ε_1, ε_2, ε_3)$, $(ε_1, ε_2, ε_3) = (1, 1, 1)$ and $(ε_1, ε_2, ε_3) = (-1, -1, -1)$ yield a constant sequence by the remark above, and all the rest can be generated by the case in which $(ε_1, ε_2, ε_3) = (1, 1, -1)$ with shift operators and reversion operators. Thus it suffices to consider the case in which $(ε_1, ε_2, ε_3) = (1, 1, -1)$, then for all $n \geqslant 1$,$$ x_{3n - 2} = \frac{α}{1 - β^3} (1 + β - β^2 - 2(β - β^2)γ),\\ x_{3n - 1} = \frac{α}{1 - β^3} (2(1 - β^2)γ - 1 + β + β^2),\\ x_{3n} = -\frac{α}{1 - β^3} (2(1 - β)γ - 1 + β - β^2). $$
Case 2.2: $α < 0$. Now (4) becomes $ε_n = -ε_{n - 3}$ for all $n \geqslant 4$. In the eight possibilities of $(ε_1, ε_2, ε_3)$, $(ε_1, ε_2, ε_3) = (1, -1, 1)$ and $(ε_1, ε_2, ε_3) = (-1, 1, -1)$ yield a sequence of period $2$ by the remark above, which is the same as the ones in case 1.1, and all the rest can be generated by the case in which $(ε_1, ε_2, ε_3) = (1, 1, 1)$ with shift operators and reversion operators. Thus it suffices to consider the case in which $(ε_1, ε_2, ε_3) = (1, 1, -1)$, then for all $n \geqslant 1$,$$ x_{6n - 5} = -x_{6n - 2} = -\frac{α}{1 + β^3} (1 + β - β^2 - 2βγ),\\ x_{6n - 4} = -x_{6n - 1} = -\frac{α}{1 + β^3} (1 + β + β^2 - 2β^2 γ),\\ x_{6n - 3} = -x_{6n} = -\frac{α}{1 + β^3} (-1 + β + β^2 + 2γ). $$
It can be verified that the sequences in case 1.1 to case 2.2 indeed satisfy the given recurrence relation.