Remember your trig identities.
$$ A\cos(x - C) = A\cos(x)\cos(C) + A\sin(x)\sin(C) $$
So if $f(x) = \sqrt{3}\cos(x) + \sin(x) = A\cos(x-C)$, then $A\cos(C) = \sqrt{3}$ and $A\sin(C) = 1$. If we square both sides and add them together, we get $$ [A\cos(C)]^2 + [A\sin(C)]^2 = A^2[\cos(C)^2 +\sin(C)^2] = A^2 = (\sqrt{3})^2 + (1)^2 = 4 $$ So $A = 2$.
From this argument it should be clear that in the general case, the amplitude of $a\sin(x) + b\cos(x)$ is $\sqrt{a^2 + b^2}$.