Let $A$ be a $n \times n$ real matrix. Let $f$ and $g$ be function of class $\textsf{C}^2$ defined in the open space $S \subset \mathbb{R}^n$. Show that if $g(x)=f(Ax)$, then $H_x(g)=A^tH_{Ax}(f)A$ , where $H$ means the hessian matrix.
To solve this problem I tried to think in the output of the function, like, if I have a vector $X=(x_1,x_2,...,x_n)$ and the matrix is formed by the column vectors $C_1, C_2,\dots,C_n$ so the output is $Ax=C_1x_1+C_2x_2+\cdots+C_nx_n$, but the analysis of the partial derivates got very hard to study.