Where is the flaw in this "proof" that 1=2? (Derivative of repeated addition)
I think the discrete/continuous issue is sort of a red herring. To me, the problem is forgetting to use the chain rule!
To un-discretize, think of the function $F(u,v) = uv$, which we could think of as $u + \dots + u$, $v$ times. Then $x^2 = F(x,x)$. Differentiating both sides gives $2x = F_u(x,x) + F_v(x,x)$, which is perfectly true. In the fallacious example, the problem is essentially that the $F_v$ term has been omitted. In some sense, one has forgotten to differentiate the operation "$x$ times" with respect to $x$! Of course, the notation makes this easier to do.
You cannot take the derivative of $\underbrace{x + x + x + \dots + x}_{\text{repeated $x$ times}}$ with respect to $x$ one term at a time because the number of terms depends on $x$.
Even beyond that, if you can express $x^2$ as $\underbrace{x + x + x + \dots + x}_{\text{repeated $x$ times}}$, then $x$ must be an integer, and if the domain of the expression is the integers, (continuous) differentiation does not make sense and/or the derivatives do not exist.
(edit: I gave my first reason first because the second reason can be smoothed over by taking "repeated $x$ times" to mean something like $\underset{\lfloor x\rfloor\mathrm{\ addends}}{\underbrace{x+x+\cdots+x}}+(x-\lfloor x\rfloor)\cdot x$.)
Here's my explanation from an old sci.math post:
Zachary Turner wrote on 26 Jul 2002:
Let D = d/dx = derivative wrt x. Then
D[x^2] = D[x + x + ... + x (x times)] = D[x] + D[x] + ... + D[x] (x times) = 1 + 1 + ... + 1 (x times) = x
An obvious analogous fallacious argument proves both
$ $ D[x f(x)] = Df(x) (x times) = x Df(x)
$ $ D[x f(x)] = Dx (f(x) times) = f(x), via Dx = 1
vs. the correct result: their sum $\rm\:f(x) + x\, Df(x)\:$ as given by the Leibniz product rule (= chain rule for times). The error arises from overlooking the dependence upon x in both arguments of the product $\rm\: x \ f(x)\:$ when applying the chain rule.
The source of the error becomes clearer if we consider a discrete analog. This will also eliminate any tangential concerns on the meaning of "(x times)" for non-integer x. Namely, we consider the shift operator $\rm\ S:\, n \to n+1\ $ on polynomials $\rm\:p(n)\:$ with integer coefficients, where $\rm\:S p(n) = p(n+1).\:$ Here is a similar fallacy
S[n^2] = S[n + n + ... + n (n times)]
= S[n] + S[n] + ... + S[n] (n times)
= 1+n + 1+n + ... + 1+n (n times)
= (1+n)n
But correct is $\rm\ S[n^2] = (n+1)^2.\:$ Here the "product rule" is $\rm\ S[fg] = S[f]\, S[g],\ $ not $\rm\: S[f] g\:$ as above.
The fallacy actually boils down to operator noncommutativity. On the space of functions $\rm\:f(x),\:$ consider "x" as the linear operator of multiplication by x, so $\rm\ x:\, f(x) \to x f(x).\:$ Then the linear operators $\rm\:D\:$ and $\rm\:x\:$ generate an operator algebra of polynomials $\rm\:p(x,D)\:$ in NON-commutative indeterminates $\rm\:x,D\:$ since we have
(Dx)[f] = D[xf] = xD[f] + f = (xD+1)[f], so Dx = xD + 1 ≠ xD
(Sn)[f] = S[nf] = (n+1)S[f], so Sn = (n+1)S ≠ nS
This view reveals the error as mistakenly assuming commutativity of the operators $\rm\:x,D\:$ or $\rm\:n,S.$
Perhaps something to ponder on boring commutes !