All values of $m,b \in \mathbb{R}$ such that $f(x) = mx+b$ is a solution to $f(f(x)) = x$ I am asked to find all values of constants $m,b \in \mathbb{R}$ such that $f:\mathbb{R}\to \mathbb{R}, x\mapsto mx+b$ is a solution to $f(f(x)) = x$.
So since $f(f(x)) = m(mx+b) + b = m^2x + mb + b$, the equation $$m^2x + mb + b = x$$ must be true. The only way for that to happen, as far as I can see, is that this system of equations must be satisfied:
$$
 \begin{cases}m^2 = 1 & \\ 
mb + b = 0
\end{cases}
$$
In the case where $m = 1$, we have the bottom equation as $b+b = 0 \iff b = 0$ so $m = 1, b = 0$ is a solution.
In the case where $m = -1$, we have the bottom equation as $-b + b = 0 \iff 0=0$ which meanss that $m=1$, $b \in \mathbb{R}$ is a solution.
Am I missing any other cases/answers? How would this answer be stated in "set-builder notation"? 
$ \Big\{m, b \in \mathbb{R} \left| (m = 1\text{ and }b = 0)\text{ or }(m = -1 \text{ and } b \in\mathbb{R}  )\Big\}\right. $? Is the extra $b \in\mathbb{R}$ redundant?
 A: You are correct, and $b\in R$ can be removed without changing the meaning; it is implied. However, in an entry-level text book, it makes better sense to have that redundancy.
A: In your set-builder notation, you should put $m,b$ into parenthesis, otherwise your set is contained in $\mathbb R$, while you want it to be subset of $\mathbb R^2$.
A correct way, along the lines of your idea, would be $$\{(m,b)\in\mathbb R^2\mid (m = 1, b = 0)\lor (m = -1, b\in\mathbb R)\},$$ but I wouldn't find it aesthetically pleasing or particularly readable. I'd prefer something like this:
$$\{(1,0)\}\cup \{ (m,b)\in\mathbb R^2\mid m = -1\}.$$
Otherwise, everything you wrote is correct.
A: Yet another solution.  Let $f$ be a solution apart from the identity and $(u,v)$ be a point of $f$ with $u\neq v$, then $(v,u)$ must also be one.  Hence the slope of $f$ has to be $-1$ (and the intercept is arbitrary).
A: Alternative solution. Note that $f(f(x))=x$ implies $f(x)=f^{-1}(x)$ (property of inverse functions). So:
$$y=mx+b \Rightarrow x=\frac{y-b}{m} \Rightarrow f^{-1}(x)=\frac1mx-\frac bm;\\
mx+b=\frac1mx-\frac bm \Rightarrow \begin{cases}m=\frac1m\\ b=-\frac bm\end{cases} \Rightarrow m_1=-1,b_1\in \mathbb R; m_2=1,b_2=0.$$
And the set builder notation:
$$\{(m,b)|(m=-1,b\in \mathbb R)\lor (m=1,b=0)\}.$$
