Prove the inequality $x+\frac{1}{x}\geq 2$? I'm reading Courant's Calculus. There is an exercise: Prove the inequality $x+\frac{1}{x}\geq 2$. 
I did the following: For the sake of curiosity, I did:
$$x+\frac{1}{x}\geq 2$$
$$x^2+1\geq 2x$$
$$x^2-2x +1\geq 0$$
And this is just $(x-1)^2$. Well, as the square of a real number is $\geq0$, then:
$$(x-1)^2 \geq 0$$
$$x^2-2x+1 \geq 0$$
$$x^2+1 \geq 2x$$
$$x+\frac{1}{x} \geq 2$$
Which is what was to be proved. Is it correct?
 A: By AM-GM, for all $x>0$:
$$\frac{x+\frac{1}{x}}{2} \geq\sqrt{x\cdot\frac{1}{x}} $$
$$x+\frac{1}{x} \geq2$$
A: You can write $$(x-1)^2 \ge 0 \\ x^2 - 2x + 1 \ge 0 \\ x^2 + 1 \ge 2x \\ x + \frac{1}{x} \ge 2,$$ omitting the third line.  However, in the last step of the above--namely, division by $x$--you should note that this only preserves the direction of inequality if $x > 0$.  Otherwise, we would reach the conclusion $$x + \frac{1}{x} \le -2, \quad x < 0.$$  Therefore, the original inequality to be shown is true only if $x > 0$.
A: $$
x+ \frac 1 x = \left( x - 2 + \frac 1 x \right) + 2 = \underbrace{\left( \sqrt x - \frac 1 {\sqrt x} \right)^2} {}+ 2
$$
The part over the $\underbrace{\text{underbrace}}$ cannot be negative, since it is a square, and is $0$ only when $x=1$.
A: In all rigor, you can transform
$$x+\frac1x\ge2$$ in
$$\frac{x^2-2x+1}x=\frac{(x-1)^2}x\ge 0.$$
Then the inequality only holds when the numerator and denominator have the same sign, which requires
$$x>0.$$

By the way, the LHS is an odd function, so that if for some $x$ you fulfill $x+\dfrac1x\ge2$, then $(-x)+\dfrac1{(-x)}\le-2$. So the inequality cannot hold for all $x$.
A: Assume $x\gt0,$ otherwise the inequality is wrong.
Either $x\ge1\ge\frac1x$ or else $x\le1\le\frac1x,$ i.e., $x-1$ and $1-\frac1x$ have the same sign,
whence
$$(x-1)(1-\frac1x)\ge0$$
and
$$x+\frac1x=2+(x-1)(1-\frac1x)\ge2.$$
