Not Understanding Proof for Derivative.

If y' = f'(x)

Then y = f(x) in one integral.

Now Let g(x) be any other integral in y' = f'(x) that is g'(x) = f'(x). Show that g(x) can differ from f(x) by at most a constant

Then Let : w' = f'(x) - g'(x) = 0

Then the equation of w as a function of x must be w = constant

hence we see that w = f(x) - g(x) equals g(x) = f(x) + constant.

Because g(x) is any integral other than f(x) all integrals are given by y = f(x) + c

How did they get from w = constant to g(x) = f(x) + constant algebraically?

second.... they said Now Let g(x) be any other integral in y' = f'(x) that is g'(x) = f'(x). But if they are two dif integrals why did they set g'(x) = f'(x)? Doesn't setting something equal to something mean they are equal? Is there something that I am misunderstanding?