In whatever follows $f$ denotes a differentiable function from $\mathbb{R}$ to $\mathbb{R}$. $f \circ f$
denotes the composition of $f(x)$.
$\textbf{(a)}$ If $f\circ f(x) = f(x) \forall x \in \mathbb{R}$ then for all $x$, $f'(x) =$ or $f'(f(x)) =$. Fill in the
blank and justify.
$\textbf{(b)}$Assume that the range of $f$ is of the form $ \left(-\infty , +\infty \right), [a, \infty ),(- \infty , b], [a, b] $.
Show that if $f \circ f = f$, then the range of $f$ is $\mathbb{R}$. [hide=Hint](Hint: Consider a maximal
element in the range of f)[/hide]
$\textbf{(c)}$ If $g$ satisfies $g \circ g \circ g = g$, then $g$ is onto. Prove that $g$ is either strictly increasing or strictly decreasing. Furthermore show that if $g$ is strictly increasing, then $g$ is unique.
1. **Part (a):** Given that \( f \circ f(x) = f(x) \) for all \( x \in \mathbb{R} \), we need to find \( f'(x) \) or \( f'(f(x)) \).

   Since \( f \) is differentiable, we can apply the chain rule to the composition \( f(f(x)) \):
   \[
   \frac{d}{dx} [f(f(x))] = f'(f(x)) \cdot f'(x)
   \]
   Given \( f(f(x)) = f(x) \), differentiating both sides with respect to \( x \) gives:
   \[
   f'(f(x)) \cdot f'(x) = f'(x)
   \]
   Rearranging, we get:
   \[
   f'(x) (f'(f(x)) - 1) = 0
   \]
   This implies:
   \[
   f'(x) = 0 \quad \text{or} \quad f'(f(x)) = 1
   \]

2. **Part (b):** Assume the range of \( f \) is of the form \( (-\infty, +\infty), [a, \infty), (-\infty, b], [a, b] \). We need to show that if \( f \circ f = f \), then the range of \( f \) is \( \mathbb{R} \).

   First, we prove that if \( f: \mathbb{R} \rightarrow \mathbb{R} \) and \( f \circ f = f \), then the range of \( f \) is either \( \mathbb{R}, [a, \infty), (-\infty, b], [a, b], \{\ell\} \).

   If \( f \) is constant, the range is a singleton, which is not interesting. Assume \( f \) is non-constant. Since \( f \) is continuous, it must have the Intermediate Value Property (IVP). If \( f(a) < k < f(b) \), then every such \( k \) is in the range of \( f \). This means the range of \( f \) is of the form \( (m, M), (m, M], [m, M), [m, M] \), where \( M \) is the supremum and \( m \) is the infimum of the set.

   Now, \( M \) can be \( +\infty \) and \( m \) can be \( -\infty \). Assume \( m \) and \( M \) are finite. We show that if both are finite, they both get achieved. For some \( \delta > 0 \), let \( x_{\delta} \in \mathbb{R} \) such that \( f(x_{\delta}) = m + \delta \). By \( f \circ f = f \), we have \( f(m + \delta) = m + \delta \). Taking the limit as \( \delta \rightarrow 0^{+} \):
   \[
   \lim_{\delta \rightarrow 0^{+}} f(m + \delta) = \lim_{\delta \rightarrow 0^{+}} (m + \delta) \implies f(\lim_{\delta \rightarrow 0^{+}} (m + \delta)) = m \implies f(m) = m
   \]
   So \( m \) is in the range. Similarly, for \( M \), taking \( \lim_{\delta \rightarrow 0^{-}} f(M - \delta) \) shows \( M \) is in the range. Hence, the range of \( f \) is either \( \mathbb{R}, (-\infty, a], [b, \infty), [a, b] \).

   Now, since \( f \) is non-constant, \( f'(x) \neq 0 \) for all \( x \). From the relation \( f'(f(x)) = 1 \), if the range of \( f \) is not \( \mathbb{R} \), one of the extremum gets achieved. W.L.O.G, say the maximum is \( b \), then \( f(b) = b \). Since the range of \( f \) is \( \mathbb{R} \), \( b \) would be an interior point. By the Interior-Extremum Theorem, \( f'(b) = 0 \), which is a contradiction. Hence, the range of \( f \) must be \( \mathbb{R} \).

3. **Part (c):** If \( g \) satisfies \( g \circ g \circ g = g \), then \( g \) is onto. We need to prove that \( g \) is either strictly increasing or strictly decreasing. Furthermore, if \( g \) is strictly increasing, then \( g \) is unique.

   Given \( g \circ g \circ g = g \), we have:
   \[
   g \circ g (g \circ g) = g \circ g
   \]
   Since \( g \circ g \) is non-constant, part (a) applies, and the range of \( g \) is \( \mathbb{R} \), making \( g \) surjective. Since \( g \circ g = x \), the inverse of \( g \) exists, making \( g \) injective. A continuous injective function is strictly monotone, so \( g \) is strictly monotone.

   If \( g \) is strictly increasing, assume \( x < g(x) \). Then:
   \[
   g(g(x)) = x < g(x) < x
   \]
   This is a contradiction. Similarly, if \( x > g(x) \), then:
   \[
   x > g(x) > g(g(x)) = x
   \]
   This is also a contradiction. Hence, \( g(x) = x \).

The final answer is \( \boxed{ f'(x) = 0 } \) or \( f'(f(x)) = 1 \)