Derive demand function from utility function with constant elasticity Consider a $n$-good industry with a representative consumer with utility function for the differentiated goods given by,

$
U=\left(\sum^n_{i=1}q_i^\beta\right)^\theta
$

Suppose that the representative consumer is endowed with income $I$.

a. Derive the inverse and direct demands;

My solution: I am writing the lagrange as:

$
L=\left(\sum^n_{i=1}q_i^\beta\right)^\theta+\lambda(I-\sum^n_{i=1}p_iq_i)
$

FOC:

$
\theta \left(\sum^n_{i=1}q_i^\beta\right)^{\theta-1}\beta q_i^{\beta-1}-\lambda p_i=0
$

So the inverse demand function is:

$
p_i=\frac{\theta \left(\sum^n_{i=1}q_i^\beta\right)^{\theta-1}\beta q_i^{\beta-1}}{\lambda}
$

Is this right? Because the $\lambda$ seems a little bit strange. If yes, how do I isolate $q_i$, when there is this sum symbol to derive the demand function?
You stopped a bit too early. 

Let me re-write the FOC for good $i$ as follows:

$$ \lambda=\frac{\theta \left(\sum^n_{i=1}q_i^\beta\right)^{\theta-1}\beta q_i^{\beta-1}}{p_i}
$$

As this is identical across goods, equalise for good $i$ and good $j$, where, after simplification, you get:

$$ \frac{q_i^{\beta-1}}{p_i} = \frac{q_j^{\beta-1}}{p_j} $$

This relation hold for any pair of goods. This means you can re-write the demand for any good in terms of $q_i$ and relative prices. Then, you can use the budget constraint to obtain the final demand for good $i$, in terms of income $I$ and all the prices. 

Hopefully this information is enough for you to move forward and solve the problem.