Which derivative is correct? Consider the following expressions:
$$C_{i}=\sum_{j=1}^{N_i}v_{j},  \quad v_j \in \mathbb{R}, \quad N_i \in \mathbb{N} $$
\begin{equation}
x_{i}=\frac{C_{i}}{N_i}
\end{equation}
I want to obtain an expression for $\frac{\partial x_i}{\partial C_{i}}$.  My first approach was to simply use the second definition  hence I obtained:
$$\frac{\partial x_i}{\partial C_{i}}=\frac{1}{N_i}$$
However, someone suggested that this was somehow wrong because $C_{i}$ was a function and not a variable. So he told me to recurr to the implicit function  theorem. Listening to his suggestion, I tried using the chain rule:
$$\frac{\partial x_i}{\partial C_{i}}=\frac{\partial x_i}{\partial v_1}\frac{\partial v_1}{\partial C_{i}}+...+\frac{\partial x_i}{\partial v_{n_i}}\frac{\partial v_{n_i}}{\partial C_{i}}=\frac{1}{N_i}N_i=1$$
Which one do you think is correct? And why? I am  sure mine, but I want an argument to prove this person wrong.
 A: It helps to define your functions explicitly. I will drop the $i$ subscripts. There are two possibilities here depending on whether you are thinking of $N$ as a fixed parameter or also as a variable. Since it does not matter for the derivative you are interested in, we will keep things simple and think of $N$ as fixed.
Assuming $N$ is fixed, you have a function of one variable $x:\mathbb{R}\to \mathbb{R}$ given by $$x(C)=\frac{C}{N}$$ for all $C\in\mathbb{R}$. The derivative is just $$\frac{dx(C)}{dC}=x'(C)=1/N.$$
"But $C$ is a function not a variable!"
Let us explicitly define the function. I will use $c$ for the function to distinguish it from the $C$ used above to denote the argument of the function $x$. I will denote $v=(v_1,\ldots,v_n)$. Again, assuming $N$ is fixed, the function is $c:\mathbb{R}^N\to\mathbb{R}$ given by $$c(v)=\sum_{j=1}^N v_j$$ for all $v\in\mathbb{R}^N$. The derivative with respect to any $v_j$ is $$c_j(v)=\frac{\partial c(v)}{\partial v_j}=1.$$
The composition $x\circ c:\mathbb{R}^N\to \mathbb{R}$ of the functions $x$ and $c$ is given by $$(x\circ c)(v)=x(c(v))$$ for all $v\in\mathbb{R}^N$. This composition is a function of $v$ only. Thus the derivative of it with respect to $C$ is zero. If we took the partial derivative with respect to $v_j$ we would get (using the chain rule): $$(x\circ c)_j(v)=\frac{\partial [x(c(v))]}{\partial v_j}=x'(c(v))c_j(v)=\frac{1}{N}(1)=\frac{1}{N}.$$
Your calculation
Your calculation using the chain rule (by the way the implicit function theorem does not come into it at all) is incorrect. You appear to have assumed that $x$ is a function of $v$ (it isn't) and that $v$ in turn depends on $C$. This second assumption of yours makes a little bit of sense, because you could solve your first equation for each $v_j$ in terms of the other $v_k$ and $C$, but it is not correct to do this. 
