Find the number of functions $4f^3(x)=13f(x)+6$ 
$f(x)$ is a function satisfying
$$4f^3(x)=13f(x)+6$$
$\forall\ x\in [-3,3]$ and is discontinuous only and only at all integers in $[-3,3]$. If $N$ denotes the unit digit of the number of all such functions, find $N$.
Answer: $6$.

Solving the cubic for $f(x)$ gives us
$$f(x)=-\frac{3}{2},-\frac{1}{2}\ \text{or}\ 2$$
Then I figured, for $f$ to be discontinuous at integers, we must define it piecewise(i.e casewise) on the integers, with the value of the function changing at integers.
Something like$f(x)=$
$$
\begin{cases}
 -0.5 & -3\leq x<-2 \\
 -1.5 & -2\leq x<-1 \\
 -0.5 & -1\leq x<0 \\
    2 &  0\leq x<1 \\
 -1.5 &  1\leq x<2 \\
 2 &  2\leq x<3 \\
 -1.5 &  x=3\\
\end{cases}
$$
So I thought, this problem is equivalent to filling $7$ blanks with $3$ distinct objects, and no two adjacent blanks contain the same object.
Hence, the first blank can be filled in $3$ ways, the second in $2$ ways, the third in $2$ ways and so on, until the seventh blank in $2$ ways.
So the number of ways is $$3\times2\times2\times2\times2\times2\times2=192$$
whose unit digit is not $6$.

Could anyone tell me where I went wrong?

Thanks in advance!
 A: Note that for each $x, f(x) \in \{-3/2,-1/2,2\}$.
Denoting Ride hand limit with RHL and Left hand limit with LHL
For $x=-3$, the discountinuity is when $f(-3) \neq RHL$.
So here $3*2=6$ values for f(-3) and RHL at x=-3 such that both aren't equal.
Now due to the above operation, RHL of x=-3 = LHL for x=-2 is fixed, as f(x) is continuous in (-3,-2)
So for x=-2, the only quantities that we haven't determined are f(-2) and RHL at x=-2. For discountinuity, atleast one of these must not be equal to RHL at x=-2. So a total of $3*3-1=8$ possibilities for f(-2) and RHL at x=-2.
Similarly x=-1,0,1,2 follow the same pattern as that of x=-2.
For $x=3$, the LHL is fixed, and the only way for discountinuity at this point is when $f(3) \neq LHL$ at x=3.
This can be done in 2 ways.
Hence a total of $6 \times 8^5 \times 2 = 3 \times 2^{17}$ functions.
And using basic number theory, we can calculate the unit digit of the above number to be $6$.
A: The following are the properties that fully characterize your function $f$:

*

*For every $x$, $f(x)\in \{2,-1/2,-3/2\}$

*$f$ must be constant on every open interval $(n,n+1)$ for $n=-3,-2,-1,0,1,2$

*among $f(n-1,n)$, $f(n)$, $f(n,n+1)$ there must be at least two different values for $n=-2,-1,0,1,2$

*$f(3) \ne f(2,3)$, $f(-3)\ne f(-3,-2)$
As you did, you can start by fixing $f(-3)$ and $f(-3,-2)$ in 6 ways. Then you can fix $f(-2)$ and $f(-2,-1)$ in $6 + 2 =8$ ways. The same 8 ways for $f(-1)$ and $f(-1,0)$, etc.
The last choice is $f(3)$ that can be made in 2 ways.
For a total of $6\times 8^5\times 2$ ways. Since $2^5\equiv 2\pmod{10}$, we have $6\times 8^5\times 2 = 3 \times 2^{17}\equiv 3 \times 2^{5} \equiv  6\pmod {10}$
