Pareto optimality and Externalities Let's consider 5 farmers, each of them has 2 cows to put into the field. 
So every farmers can put 0,1 or 2 cows. I denote the three stategies by $q_i$, i=0,1,2. 
Now, the payoffs ( i.e. the amout of food that each cow will eat) are given by:
$$
u_{i}(q_1,...,q_5)=q_{i}(12-(q_{1}+...+q_{5}))
$$
Now, for finding the Nash equilibrium I draw the matrix which has on the row one player and on the columns the others four. I observe that strategy 2 stricly dominates 1 so the N.E. is given by (2,2,2,2,2) and the correspinding payoffs are (4,4,4,4,4). 
(If I estend the strategies to $q_{i}\in[0,2]$ the N.E. remains the same, right?) 

Now, the Pareto optimality, if I have understood well should be the strategies (1,1,1,1,1) which give me as payoffs (7,7,7,7,7). Are there other pareto optimality profile? Because I think that I have understood the problem for 2 players but for more I'm not totally sure. 

Then, the last question :) If I tax (c) farmers that put two cows in the field, how much I should tax to inforce N.E?
For replying to this I have think in that sense: for strategy I have that my payoffs functions are given by 
$$
u_{i}(q_1,...,q_5)=q_{i}(12-(q_{1}+...+q_{5})-c) 
$$
Hence, if I look to the payoff matrix in order to have strictly dominance of strategy 2 I should impose c=1.
The idea behind Pareto optimality is efficiency. On the discrete set, there is no allocation where, compared to $(1,1,1,1,1)$, we could make someone better off and keep the others at least indifferent. This is why this allocation is Pareto optimal. However, any other efficient allocation (in the sense that we are not throwing away resources) will be Pareto optimal here as well. 

For the set in $\mathcal R$, we assume a symmetric solution and solve

$$\max_{q\in[0,2]} 5\cdot q(12-(5q))$$
$$\Rightarrow 5(12-5q) -25q$$

The first term is the direct benefit of increasing $q$, the second one is the externality (that we now internalize). The interior solution is given by $q = 1.2$ where everyone gets the payoff $7.2$. We know that the interior solution solves the problem given that the boundaries $0, 2$ both delivered lesser value than $q=1$. 

Finally, for the tax, derive the FOC of the agents given a general tax $c$. Then, look for the optimal quantity you want them to have, that is, replace $q_i$ with $q_i^*$, the welfare-maximizing solution, and then look for the value of $c$ that would solve the FOC (and hence make the farmers optimally chose what you want them to).