Find positive integers $c,d$ so that there are nonempty finite sets of integers $A,B$ such that $x+c\in B$ if $x\in A$ and $x^2−d\in A$ if $x\in B$. I have no idea how to approach the following problem:
Problem:
a) Find all non - empty finite sets of integers $A$ and $B$ such that:
i) when $x \in A$, $x+1 \in B$
ii) when $x \in B$, $x^2-4\in A$
b) find all positive integers $c$ and $d$ such that there are non empty finite sets $A$ and $B$ such that when $x \in A$, $x+c \in B$ and when $x \in B$, $x^2-d\in A$.
I do not even understand the mark scheme to the solution to this problem and was wondering if anyone could explain to me how to solve this with elaborate explanations. I would appreciate it.
The mark scheme continues to plug in $x$ and and $x+1$ to $x^2-4$ few times repeatedly then states that this continues indefinitely hence A and B are sets which contain a single element. I have no clue how that pattern occurring indefinitely implies the sets have a single element.
For instance for the set $A=\{0\}$ doesn't this mean that the only element in this set is is $x= 0\in A $. So if $x=0,$ and we repeat i) ii) indefinitely, $0 \rightarrow 1 \rightarrow -3 \rightarrow -2 \rightarrow 0$. So when $x=0$ in $A$ then $1$ is in $B$, $-3$ is not in $A$ since $A = \{0\}$. I do not know what I am missing here.
 A: Your second example shows that $A= \{0, -3\}, B = \{1, -2\}$  satisfies i) and ii). "Finite" does not mean "contains a single element."
In general, if $1 < x \in A$ then $x+1 \in B$ so $(x+1)^2 - 3 = x^2 + 2x -2 \in A$. But $x^2 + 2x -2 > x$, so $A$ contains something bigger than $x$. Then $A$ contains something bigger than that, and so on, so it isn't finite.
So all that's left to check is what happens if $A$ contains $1$ or a negative integer other than $-3$.
If $1 \in A$ then $B$ must contain $1+1 = 2$. Then $2^2 -4 = 0 \in A$ and we know what happens then. So $A= \{0, 1, -3\}, B = \{1, 2, -2\}$  also satisfies i) and ii).
Now try to make a similar argument for the other possible negative values of $x \in A$. You will either find more finite examples, or show that the cycle keeps generating new elements in each set.
Then get to work on b).
A: Here is what I think, I hope it helps.
I started with zero as an element in A by guessing.

Edit
One should try to prove this mathematically rather than by trial and error, but I was not able to spend the effort and may not have enough knowledge.
According to @EthanBolker's comment below, there exists more than 1 solution. I have been able to find only these by trying some values. Values quickly get large/small as seed assumes larger/smaller values so testing becomes hard.

I typed the following formulae in Spreadsheet to help me where _One=1 and _Four=4 and I started from row 1 and column 1:

add as many rows...
