I'm learning about group actions (just the basics right now) and an example has come up in the book for which I do not see how the algebra works the way it does. I'm sure it's something simple I'm overlooking but would like some clarification, nevertheless. The example is set up as follows:
Suppose $G$ acts on a set $X$. For any two sets $X$ and $Y$ recall that $Y^X$ is the set of functions from $X$ to $Y$. If $G$ acts on $X$, we claim that $$g \cdot f(x) = f(g^{-1} \cdot x)$$ defines a group action of $G$ on $Y^X$
Now in proving the second property (the non-identity one) from the function definition of a group action we see that for $g,h \in G$ and $f \in Y^X$
$$\begin{align} g \cdot (h \cdot f)(x) &= h \cdot f(g^{-1} \cdot x) \\ &= f(h^{-1} \cdot (g^{-1} \cdot x)) \\ &= f(h^{-1}g^{-1} \cdot x) \\ &= f((gh)^{-1} \cdot x)\\ & = gh \cdot f(x). \end{align}$$
Now, why is it that we don't get, for the second expression (after the first equality) that $g \cdot f(h^{-1} \cdot x)$? I ask because up to this point every expression in the text has been evaluated right to left, however this seems to be evaluated left to right in terms of the elements of $G$ in acting on the element of $Y^X$.
Because
$$\color{red}g\cdot\underbrace{(\color{blue}{h\cdot f})}_{k}(x)=\underbrace{\color{blue}{h\cdot f}}_{k}(\color{red}{g^{-1}}\cdot x)$$
by definition.