Let $a\in\mathbb{C}^*$ with $|a|\not=1$. Let $m\in\mathbb{Z}$. Find all functions $g:\mathbb{C}^*\to\mathbb{C}^*$ and constants $c\in\mathbb{C}^*$ such that $g(x)=g(a^mx)c^m$.
I know one possibility is to let $n\in\mathbb{Z}$ then $c=a^n$ and $g(x)=x^{-n}$. My desired result is to have this be the only possible solution.