<s>[INST] 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? 
 [/INST] 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$.
</s>