Step 1: Given,
\[
x+\frac{1}{x}=2\cos\theta
\]
Step 2: Multiply by \(x\):
\[
x^2+1=2x\cos\theta
\]
\[
x^2-2x\cos\theta+1=0
\]
Step 3: Since \(x\) is real, discriminant must be non-negative:
\[
D=(-2\cos\theta)^2-4(1)(1)\geq 0
\]
\[
4\cos^2\theta-4\geq 0
\]
\[
\cos^2\theta\geq 1
\]
Step 4: But for any angle,
\[
-1\leq \cos\theta \leq 1
\]
So,
\[
\cos^2\theta=1
\]
\[
\cos\theta=\pm 1
\]
\[
\boxed{\pm 1}
\]