f'(x) != g'(x) because there is an error in the calculation of f'(x).

When you write f(x) = x+x+x .. (x times) .. +x ,
what do you mean by 'x times' ?? x is not something like 1, 2, 3 .. it's just a variable.
So, you are writing f(x) as sum of a variable, variable times.

Now, when you differentiate f(x) : [[ D(h(x)) = Derivative of h(x) w.r.t. x ]]
you do it like f'(x) = D(x) + D(x) + ..(x times).. + D(x) which is invalid.
The formula D(nx) = nD(x) is valid ONLY for constant n, not a variable one.
So, f'(x) != x * D(x)

PS : The correct way will be to do it like :
f(x) = x + x + ..(x times).. + x
So, f'(x) = D(x) + D(x) + ..(x times).. + D(x) + x
Note that, I have used the multiplication formula above.
Multiplication formula : D( u(x) * v(x) ) = v(x)*D(u(x)) + u(x)*D(v(x))

So, f(x) = x + x + ..(x times).. + x
=> f'(x) = xD(x) + x
=> f'(x) = x+x = 2x = g'(x)