if $f_{n}(x)=f(f_{n-1}(x))$then $f_{10}(x)=x,x\in [0,1]$ 
Define the function $f:[0,1]\to[0,1]$ by the following.
  $$f(x)=\begin{cases}
x+\dfrac{1}{2},&0\le x\le\dfrac{1}{2}\\
2(1-x),&\dfrac{1}{2}<x\le 1.
\end{cases}$$ Let $f_1(x)=f(x)$ and for each $n\in\mathbb{N}\cap[2,\infty)$, define $f_n(x)$ as
  $$f_{n}(x)=f(f_{n-1}(x)).$$  Finally, define the sets $A$ and $B$ by $$A=\{x\in[0,1]\,|\,f_{10}(x)=x\}, B=\left\{\dfrac{2}{15},\dfrac{2}{3},0,\dfrac{1}{2},1\right\}.$$



*

*Determine the intersection of $A$ and $B$.

*Determine the cardinality of $A$.


my idea: since $$0\le x\le\dfrac{1}{2},\Longrightarrow x+\dfrac{1}{2}\in [\dfrac{1}{2},1]$$
and
$$\dfrac{1}{2}<x\le 1\Longrightarrow 2(1-x)\in [0,\dfrac{1}{2}]$$
so
$$f_{2}(x)=f(f_{1}(x))=\begin{cases}
2(1-(x+\dfrac{1}{2}))=1-2x&0\le x\le \dfrac{1}{2}\\
2(1-x)+\dfrac{1}{2}=\dfrac{5}{2}-2x&\dfrac{1}{2}<x\le 1
\end{cases}$$
follow. I think this problem will take some time to solve. Maybe there are other methods? Thank you 
 A: In a nice computation-based analysis, mvw observed a Fibonacci-like structure in the graphs of the functions $f_n$.  This structure is easy to prove by thinking inductively about the composition of the function.  Each graph consists of a sequence of "short" and "long" segments, where each short segment has $[1/2,1]$ for its range and each long segment has the entire interval $[0,1]$ for its range.  Given the graph for $f$, each short segment becomes a long segment in the next iteration, while each long segment splits into a long segment plus a short segment (the split occurs at the midpoint).  Symbolically, we have $s\to L$ and $L\to Ls$ at each iteration.  This clearly leads to Fibonacci numbers:  $s\to L\to Ls\to L^2s\to L^3s^2\to L^5s^3\to\ldots$.
Consequently, by $f_{10}$, the short segment for $f=f_1$ has split into $21$ short segments and $34$ long ones, while the long segment has split into $55$ long segments and $34$ short ones, for a total of $144$ segments, as mvw observed.  The reason for keeping separate counts is for the purpose of determining the cardinality of the OP's set $A$, the solutions to $f_{10}(x)=x$:  Each long segment intersects the straight line $y=x$ exactly once, but of the short segments, only the ones with domain in $[1/2,1]$ do so.  Thus
$$|A|=34+55+34=123$$
which also agrees with what mvw found computationally.
As for the intersection of $A$ and $B=\{{2\over15},{2\over3},0,{1\over2},1\}$, I agree with the comment by N.S., that this is perhaps best found by straightforward computation of $f_{10}(x)$ for those five values. 
One comment regarding mvw's graphs:  The sawteeth there are much more ragged and irregular than they are in actuality -- in actuality, the max's and min's are all at $0$, $1/2$ and $1$.  This flaw in the graphs is presumably because of default settings in the plotting algorithm (the fault is in default...).  As mvw astutely said upfront, a picture is worth a thousand words, but is no rigorous proof.
