Lieb studied the best constant and extremal functions for the Hardy-Littlewood- Sobolev inequalities. The special case when the inequality is conformally invariant is closely related to the Yamabe problem. I will discuss some recent progresses on the regularity and symmetry property for the associated Euler- Lagrange system and applications of the approach to sharp integral inequalities for harmonic functions and some conformally invariant integral equations motivated from Carleman's proof of two dimensional isoperimetric inequality.