$EPE = \int\int {(y-g(x))^2f(x,y)dxdy}$
By Bayes' Theorem $f(x,y)=f(y\,|\,x)\,f(x)$ we have:
$EPE = \int\int {(y-g(x))^2f(y\,|\,x)\,f(x)dxdy}$
Rearranging gives:
$EPE = \int f(x)\;\left(\,\int (y-g(x))^2f(y\,|\,x)dy\,\right)\;dx$
Using definition of $E_x$ we get:
$EPE = E_x(\;\int (y-g(x))^2f(y\,|\,x)dy\;) $
Using definition of $E_{Y\,|\,X}$ we get:
$EPE = E_x(\;\;\;E_{Y\,|\,X}(\,(Y-g(X))^2\,|\,X\,)\;\;\;) $
Or an even shorter notation:
$EPE = E_xE_{Y\,|\,X}(\,[Y-g(X)]^2\,|\,X\,) $