Let $f(x)$ be a function defined on $\mathbb{R}$ as $$f(x)=\sin \frac{\pi x}{2}.$$ For $y\in \mathbb{R}$, consider the sequence defined by $$x_0(y)=y\ \ \text{and}\ \ x_{n+1}(y)=f(x_n(y)) \ \text{for all}\ n\geq 1.$$ Let$$g(y)=\lim_{n\to\infty} x_n(y)\ \text{for}\ y\in [0, 3].$$Then show that $$\int_0^3 g(y)\, dy=1.$$
I start by taking an initial point and write the sequence $x_n$ as $$y, \sin \frac{\pi y}{2}, \sin \bigg(\frac{\pi}{2} \sin\frac{\pi y}{2}\bigg), \ldots.$$ If $y=0$, then the whole sequence is $0$. If $0<y<2$, (for example $1$), then the sequence becomes $$1, \sin 1, \sin \bigg(\frac{\pi}{2} \sin 1\bigg), \ldots.$$This is a decreasing sequence towards $0$. If $y=2$, then again $0$ sequence. If $2<y\leq 3$, then the sequence becomes a negative sequence (for example if $y=3$), then $$3, -1, \sin (-1), \sin (\frac{\pi}{2}\sin (-1)), \ldots.$$ How to think about the limit?
If $0 < y < 2$ then $0 < x_1(y) < 1$, so that $(x_n(y))_{n \ge 1}$ is strictly increasing. It is also bounded above by $1$ and therefore convergent. The limit $g(y)$ must satisfy $g(y) = f(g(y))$, and therefore $$ g(y) = 1 \quad \text{for } 0 < y < 2 \, . $$
Similarly, if $2 < y < 3$ then $-1 < x_1(y) < 0$, and $(x_n(y))_{n \ge 1}$ decreases to $g(y) = -1$.
Therefore $$ \int_0^3 g(y) \, dy = \int_0^2 1 \, dy + \int_2^3 (-1) \, dy = 2-1 = 1 \, . $$
The following plot of $x_1(y)$ (blue), $x_2(y)$ (red), $x_3(y)$ (green) demonstrates the behavior: