Upper index notation: exponent or function iteration? Knowing that $$ \sin^{-1}(x)=\arcsin(x)$$
I find it confusing that many people write $$ \sin^{2}(x)$$ meaning $$ \sin(x)^{2}$$
So let's make things clear: which is true:

*

*$$ \sin^{2}(x)=\sin(x)^{2} $$
or rather

*$$\sin^{2}(x)=\sin(\sin(x))$$
 A: Maybe too long for a comment.
The people who deal in algebraic and arithmetic dynamics regularly write $f^n$ for the $n$-fold iteration of $f$. This is unquestionably ambiguous, and a well-written paper will make this convention explicit.
No question what $\sin^2(x)$ means: it’s universally understood to be $\sin(x)\sin(x)$. But that does not accord at all with the meaning of $\sin^{-1}(x)$, so it is fully understandable that you say you are confused.
For my own part, when I teach, I try always to use the notation $\arcsin(x)$. As it happens, in my research I deal almost always with iteration of functions, but with enough use of raising to powers that it’s necessary to have two recognizably different notations. For the $n$-fold iteration of $f$, I write $f^{\circ n}(x)$, but if the inverse function comes up, I write in the text that $f^{-1}$ is an exception, that is, that I’m intentionally omitting the little circle. For raising to a power, I use the standard notation $f^n$.
A: Established notation is sin x, cos x, etc. and log x
in addition to sin$^2$ x, cos$^2$ x, etc. for (sin x)$^2$, (cos x)$^2$, etc.
That is because of the frequency of the squared trig functions in trigometric identities.  On the other hand sin sin x, cos cos x, etc are never seen.
Unambiguously arcsin x = sin$^{-1}$ x, arccos x = cos$^{-1}$ x, etc.
log$^2$ x for (log x)$^2$ is not established notation nor is it used for log log x.
sin(x), cos(x), etc and log(x) are recent nusiances. likely  intrusions, like 10 mod 3 = 1, by computer think. 
When it comes to notation where functions are denoted by one letter, then write f(x)$^2$ to avoid confusion with f$^2$(x) = f(f(x)).  When refering to a function by just its letter one could used (f)$^2$ for the function squared and f$^2$ for iterating the function.
Yes, mathematics, like any language, has it idioms.
Mathematics and computer talk are two different languages and by knowing one, it is arrogance to think one knows the other even for simular concepts.
The languages for thermodynamics in physics and thermodynamics in chemistry are so different that a translating dictionary has been wrtten.  
A: $$\sin^ax$$ normally denotes a power of the sine, with the only, unfortunate exception
$$\sin^{-1}x$$ (prefer $\arcsin$).
Then
$$\sin^{(n)}x$$ normally denotes the $n^{th}$ derivative. This notation can also be used for the iterated sine, as can
$$\sin_nx.$$
In case of possible ambiguity, the convention in use must be announced.
