Determine price and cost of intermediate good Consider a world where an intermediate good is produced using a linear production function in a competitive market:

$$ Y = qAL$$

where $q$ is the price of the intermediate good, $A$ is productivity. Due to perfect competition, profits are given by

$$ 0 = \pi = (qA-w)L$$

where $w$ are wages. Due to perfect competition, we have that $w = qA$.

Now consider a final production sector where some market power exists. Why is - I believe - irrelevant to the exposition here. Due to some cost of entry to the final sector, we can determine the measure of firms in the final sector, $S$. Each of these final good firms $i$ then will sell the final good at price $p_i$. That is, we have some non-degenerate price distribution in the final sector.

Now, we have a measure $S$ of final sector firms that require the intermediate good. 

Assumption 1 Let's assume for simplicity, that they all will purchase the same quantity (although the quantity is irrelevant due to the linearity of the intermediate good's production function).

How would the price $q$ be determined in this setup, with and without assumption 1?


Can there be market power for the final sector, given that there is a continuum of firms in both sectors? 
If so, how does the price-setting work?
In particular, if there is market power on one side, the price should be equal to marginal cost.


However, so far, I was using the FOC $w = qA$: taking the price as given and use that as the wage. Due to linearity of the production function, I feel that I cannot determine both $w$ and $q$ at the same time here. Is that correct? What's the way to go?
One way to close the model is through the labor market equilibrium. The OP clarified that the final-goods sector does not use labor.  

Let $D_y = D_y(q)$ be the total demand for the intermediate good, in quantities. Since the market for the intermediate good is competitive it will clear, so we have

$$D(q) = AL \implies L^d = D(q)/A$$

Let $L^s(w)$ be labor supply coming from the utility maximization problem of the households and depending also on the wage. Assume a competitive labor market. Then the wage will adjust to clear it. Here we have

$$L^s(w) = L^d = D(q)/A$$

which gives us a second relation between $w$ and $q$, alongside $w=qA$, and it permits to determine both simultaneously.