Classes of Functions Closed Under Polynomial Composition - Papadimitriou Exercise 7.4.4
For item (d):

Closed under left polynomial composition: Consider an arbitrary $f(n) = 2^{n^{k_1}} \in C$ and an arbitrary polynomial $p(n)$. There exists some $k_2$ such that $p(n) \leq n^{k_2}$, for sufficiently large $n$. For sufficiently large $n$, $p(f(n)) \leq [f(n)]^{k_2} = [2^{n^{k_1}}]^{k_2} = 2^{k_2 n^{k_1}}$. There exists $k_3$ such that $2^{k_2 n^{k_1}} &lt; 2^{n^{k_3}}$ for sufficiently large $n$. Therefore, choosing $g(n) = 2^{n^{k_3}} \in C$ we have $p(f(n)) = O(g(n))$.
Closed under right polynomial composition: Consider an arbitrary $f(n) = 2^{n^{k_1}} \in C$ and an arbitrary polynomial $p(n)$. There exists some $k_2$ such that $p(n) \leq n^{k_2}$, for sufficiently large $n$. For sufficiently large $n$, $f(p(n)) = 2^{[p(n)]^{k_1}} \leq 2^{(n^{k_2})^{k_1}} = 2^{(n^{k_2 k_1})}$. Therefore, taking $g(n) = 2^{(n^{k_2 k_1})} \in C$ we obtain that $f(p(n)) = O(g(n))$.

For item (e):

Closed under left polynomial composition: Consider an arbitrary $f(n) = \log^{k_1} n$ and an arbitrary polynomial $p(n)$. Then, exists some $k_2$ such that $p(n) \leq n^{k_2}$, for sufficiently large $n$. Therefore, for sufficiently large $n$, $p(f(n)) \leq f(n)^{k_2} = (\log^{k_1} n)^{k_2} = \log^{k_1 k_2} n$. Choosing $g(n) = \log^{k_1 k_2} n$ we have $p(f(n)) = O(g(n))$.
Closed under right polynomial composition: Consider an arbitrary $f(n) = \log^{k_1} n$ and an arbitrary polynomial $p(n)$. Then, exists some $k_2$ such that $p(n) \leq n^{k_2}$, for sufficiently large $n$. Take $g(n) = \log^{k_1} n$. We have, for sufficiently large $n$:
$ f(p(n)) = \log^{k_1} p(n) \leq \log^{k_1} (n^{k_2}) = 
 (k_2 \log n)^{k_1} = {k_2}^{k_1} \log n^{k_1} = O(\log n^{k_1}) = O(g(n))$.