The following is clear:
$x\sqrt{x^2-a^2}=x\sqrt{a^2}\sqrt{\frac{x^2}{a^2}-1}=ax\sqrt{\frac{x^2}{a^2}-1}= a^2\frac{x}{a}\sqrt{\frac{x^2}{a^2}-1}$.
So I get that $$\int\frac{1}{x\sqrt{x^2-a^2}}dx=\frac{1}{a^2}\int\frac{1}{\frac{x}{a}\sqrt{\frac{x^2}{a^2}-1}}dx=\frac{1}{a^2}\arccos(\frac{a}{x})+C$$
Is this correct?
You are almost there. Consider $x/a =z.$ This gives $dx = a dz$. That means one of a's will be cancelled. Note that I am assuming that the given number $a$ is nonnegative. Anyway, your solution is correct. You just need to adjust the coefficient with $cos^{-1}(x/a)$.