$\begin{array}{}\text{(1)}& \underset{n\to \mathrm{\infty}}{lim}\frac{\mathrm{\#}\{{X}_{n}\in [a,b]\}}{n}=k{\int}_{a}^{b}{\mathrm{sin}}^{2}\theta d\theta \text{}\text{}where\text{}{k=\frac{2}{\pi}}\end{array}$

Please note that I have added a factor $k={\frac{2}{\pi}}$. See later.

First of all, as the values taken by the LHS of (1) are between 0 and 1, the same must be true for the RHS of (1).

This is why I have added factor $k$ in order that

$\frac{2}{\pi}{\int}_{0}^{\pi}{\mathrm{sin}}^{2}\theta d\theta =1.$

Let ${f}_{X}$ and ${F}_{X}$ be the pdf and cdf resp. of random variable $X$.

The LHS of (1) is plainly ${\int}_{a}^{b}{f}_{X}(x)dx$ under the classical "subjectivist" assumptions of probability (I think that the error term $O(\mathrm{log}(n)/n)$ comes from a theorem of De Finetti, not sure, but we don't need it ; I would even say that I find its presence a little strange).

Therefore, if identity (1) is valid for any $a,b$, they define a same measure ; therefore:

${f}_{X}(x)=k{\mathrm{sin}}^{2}(x)=k\frac{1}{2}(1-\mathrm{cos}(2x))=\frac{1}{\pi}(1-\mathrm{cos}(2x))$

giving, by integration:

${F}_{X}(x)=\{\begin{array}{ll}0& \text{for}\text{}x0\\ \frac{1}{\pi}(\frac{1}{2}x-\frac{1}{4}\mathrm{sin}(2x))& \text{for}\text{}x\in [0,\pi ]\\ 1& \text{for}\text{}x\pi \end{array}$

Let $Y:={\mathrm{cos}}^{2}X$.

Let us compute the cdf of $Y$ which can take values $y\in [0,1]$.

${F}_{Y}(y)=P(Y<y)=P(-\sqrt{y}<\mathrm{cos}X<\sqrt{y})=2P(\mathrm{cos}X<\sqrt{y})$

(last equality by symmetry of the pdf of $X$ wrt $\pi /2$)

${F}_{Y}(y)=2P(X<\underset{c}{\underset{\u23df}{{\mathrm{cos}}^{-1}(\sqrt{y})}})=2{F}_{X}(c)$

$\begin{array}{}\text{(2)}& {F}_{Y}(y)=2\frac{1}{\pi}[\frac{1}{2}c-\frac{1}{4}\mathrm{sin}(2c)]\end{array}$

It remains to express (2) in a simpler form, and finally to take the derivative of cdf ${F}_{Y}$ with respect to $y$ in order to get the pdf ${f}_{Y}$.