how to calculate E(1/x) and E(1/X^2)when given E(X)=3
No you are not...
For any bounded function g, we have $\displaystyle E[g(X)]=\int_{\mathbb{R}} f(x)g(x) ~dx$
where f is the pdf of X.
So just substitute here :
$\displaystyle E[1/X]=\int_{\mathbb{R}} \tfrac 1x \cdot f(x) ~dx$
I didn't explicitly write f, the pdf of a Gamma distribution, because there exist 2 versions of it.
Does it agree with what is here: Inverse-gamma distribution - Wikipedia, the free encyclopedia