A partial answer: some cases of uniqueness and some cases of non-uniqueness.
Since $f$ is only defined a.e., we may identify $0$ and $1$ and pose the problem in $\mathbb{R}/\mathbb{Z}$, which we may identify with $[0,1)$ as a measure space. If we denote $\tau:[0,1)\to[0,1)$ the translation $x\mapsto x-r\mod 1$, and define $\alpha:=-\frac c d\chi_{[0,r)}-\frac ab\chi_{[r,1)}$ the conditions can be rewritten as a fixed point equation: $f(x)=\alpha(x)f(\tau(x))$ (a.e.).
Situation 1. Assume $|c|<|d|$ and $|a|<|b|$ (or also, $|c|>|d|$ and $|a|>|b|$). Then $\|\alpha\|_\infty<1$ (respectively, $\|\frac1 \alpha\|_\infty<1$ ) and taking the $L_2$ norms $\|f\|_2\le\|\alpha\|_\infty\|f\circ\tau\|_2=\|\alpha\|_\infty\|f\|_2$ whence $f=0$ (the other case is analogous).
Situation 2. Now assume $r$ is rational, thus $r=\frac kn$ with $0<k<n$ and $(k,n)=1$. Then the $n$ intervals $I_j:=\tau^j([0,\frac1n))$, $0\le j<n$ are a partition of $[0,1)$, $k$ of which are included in $[0,r)$, the other $n-k$ being included in $[r,1)$.
If we define freely $f$in the interval $[0,\frac1n)$ the equation determines it uniquely on $[0,1)$, with a compatibility condition, namely $f(x)=\Big[\prod_{0\le j<n}\alpha(\tau^j(x))\Big]f(x).$ Note that for any $x\in[0,1)$ the $n$ iterates $\{\tau^j(x)\}_{0\le j<n}$ are a choice of representatives for the mentioned partition, so the compatibility conditionscondition writes $$\Big(-\frac cd\Big)^k\Big(-\frac ab\Big)^{n-k}=1,$$ soand we have a closed infinite dimensional linear space of solutions, or no nonzero solutions, according whether this condition holds or does not.