In the following author rotates with unit vector to find that rotation does not change it. But why does author take the vector to be rotated as unit vector, not any other vector, $ \vec{v}.$
Is it enough to use unit element itself while proving that it is the unit element?
Otherwise, what is the intention here?
https://www.geometrictools.com/Documentation/Quaternions.pdf
Edit : Actually unit vector rotation changes a vector. So author rotate a vector by itself to test if it's unchanged and determine the rotation formula is correct. Because rotating a vector by itself will result same vector as this will not actually change direction of vector.


The unit vector $\hat u$ identifies the axis of rotation. The direction of the vector also helps identify the direction of rotation.
There is no absolute reason why we must use a unit vector to identify the axis; in principle any vector pointing in the same direction would identify the same axis and the same orientation of rotations around that axis. That is, the vector $u = r\hat u,$ where $r$ is a real number and $r > 0,$ identifies the same axis and the same orientation.
But all the author needs to do is to identify the axis and orientation. We only need one vector to do that. Since we have all these vectors that can do that job, why not choose one that is convenient for the proof? And $\hat u$ is precisely that vector.
Your "proof" is flawed; you have forgotten (or did not learn) that multiplication of quaternions is non-commutative. So in general
$$ v (\cos\theta - u\sin\theta) \neq (\cos\theta - u\sin\theta)v, $$
and so you cannot just "move" the $v$ to the right of $(\cos\theta - u\sin\theta)$ in order to multiply $(\cos\theta + u\sin\theta)$ and $(\cos\theta - u\sin\theta)$ directly. The proof in the linked document works because it uses the same quaternion $\hat u$ in both places and not two quaternions $u$ and $v$, and when you are multiplying $\hat u$ times $\hat u$ it naturally makes no difference which copy of $\hat u$ you use first.
And yes, it is a very strange and wonderful thing that merely by adding a real component (which can be zero) to the "axis vector" quaternion and scaling both components so that you have a unit vector again, you get a rotation around the "axis vector."