Simplifying the body of a pure function
fun = Function[{x}, Cos[x] Cot[g]/Sqrt[-Cos[a]^2 Cot[g]^2 + Sin[a]^2]];
fun[[2]] =
FullSimplify[fun[[2]] /. a -> ArcSin[k Cos[g]], 0 < g < Pi/2];
fun
fun = Function[{x}, Cos[x] Cot[g]/Sqrt[-Cos[a]^2 Cot[g]^2 + Sin[a]^2]];
fun[[2]] =
FullSimplify[fun[[2]] /. a -> ArcSin[k Cos[g]], 0 < g < Pi/2];
fun