You are right about $f(x^2)$; and $f(x)^2$ simply means $f(x)f(x)$. The troublesome notation is $f^2$, whether used to talk about the function $f^2$ or its value at the point $x$, namely $f^2(x)$. One convention often used is that it is the function whose values are the squared values of $f$, namely $f^2:x\mapsto f(x)^2$. However, in the sort of mathematics where we are more interested in compounding functions than in doing algebraic operations on their values, concatenation is a convenient way to represent composition, particularly because such composition is associative. Thus, $fgh$ means $x\mapsto f(g(h(x)))$. Using a more explicit expression of composition, we might write this associativity as $(f\circ g)\circ h=f\circ(g\circ h)$, but writing all those little circles is rather tedious when we are not doing algebra with the values and don't need to distinguish it from composition.
In any text where there is a need to do both compounding of functions and algebraic operations on their values to a significant extent, the authors will normally be aware of the problem and carefully explain just what notational conventions they are using.