How to prove $2\le\frac{g(x)}{g(y)}+\frac{g(y)}{g(x)}$ using AM-GM? In this question Prove that, if $g(x)$ is concave, for $S = {x : g(x) > 0}$, $f(x) = 1/g(x)$ is convex over $S$. , in the proof of Math536, 

how to prove $2\le\frac{g(x)}{g(y)}+\frac{g(y)}{g(x)}?$

This is the proof of Math536:
$$\begin{align}
1 &= (a+(1-a))^2 \\
&= a^2 + 2a(1-a) + (1-a)^2 \\
&\le a^2 + a(1-a)\left(\frac{g(x)}{g(y)} + \frac{g(y)}{g(x)}\right) + (1-a)^2 \\
&= (ag(x)+(1-a)g(y)) \left(\frac{a}{g(x)} + \frac{1-a}{g(y)}\right) \\
&\le g(ax+(1-a)y) \left(\frac{a}{g(x)} + \frac{1-a}{g(y)}\right) \\
&= \frac{af(x) + (1-a)f(y)}{f(ax+(1-a)y)}
\end{align}$$
He said we should use the AM-GM inequality which is $\forall a_i\in\mathbb R^+: \frac{a_1+...+a_n}{n}\ge (a_1\dots a_n)^{1/n}.$
I tried to find a similarity with the LHS of the AM-GM inequality:
$$g(x)f(y)+f(x)g(y)\ge\sqrt{g(x)g(y)f(x)f(y)}$$
I honestly don't know how will I get the $2$ in the inequality?
Can someone help me please? 
 A: Simply: $$\dfrac{g(x)}{g(y)}+\dfrac{g(y)}{g(x)} = 2+\Bigg(\sqrt{\dfrac{g(x)}{g(y)}} - \sqrt{\dfrac{g(y)}{g(x)}}\Bigg)^2$$
A: There is no need for the general AM-GM here. Suppose you have two positive real numbers $a, b > 0$ (justified since $g(x), g(y) > 0$). Then,
$$2 \leq \frac{a}{b} + \frac{b}{a} = \frac{a^2+b^2}{ab} \iff$$
$$2ab \leq a^2+b^2 \iff a^2-2ab+b^2 \geq 0 \iff (a-b)^2 \geq 0$$
with equality iff $a=b$.
A: Put $a_1 = g(x)^2$, $a_2 = g(y)^2$. Then the inequality says
$$\frac{g(x)^2 + g(y)^2}{2} \geq \sqrt{g(x)^2g(y)^2}.$$
Rearrange the inequality, separate the sum and simplify to obtain
$$\frac{g(x)}{g(y)} + \frac{g(y)}{g(x)} \geq 2.$$
A: Don't worry about functions.
For any two $x,y$ then $\frac {g(x)}{g(y)} = k$ will be a positive number, and $\frac {g(y)}{g(x)} = \frac 1k$.
So by AM-GM.  $\frac {k + \frac 1k}2 \ge \sqrt {k*\frac 1k}=1$.
And that's it.
....
In fact this basically is the proof of the AM-GM.
$(k - 1)^2 \ge 0$ so
$k^2 + 1 \ge 2k$ so
$k + \frac 1k \ge 2$.
Or in general:
$(\sqrt a - \sqrt b)^2 \ge 0$ so 
$a + b \ge 2\sqrt{ab}$ so 
$\frac {a+b}2 \ge \sqrt{ab}$. 
A: As an alternative by Rearrangement inequality
assume wlog $g(x)\geq g(y)\implies \frac{1}{g(y)}\geq\frac{1}{g(x)}$
thus
$$\frac{g(x)}{g(y)}+\frac{g(y)}{g(x)}\geq \frac{g(y)}{g(y)}+\frac{g(x)}{g(x)}=2$$
