Polynomial Division - Remainder when divisor is squared??

Let $$f(x)$$ be a polynomial. If $$(x-a)$$ is a factor of $$f(x)$$, prove that if $$f(x)$$ is divided by $$(x-a)^2$$, the remainder will be equal to $$n(x-a)$$ for some real value $$n$$.

I have tried setting $$f(x)$$ to equal $$g(x)(x-a)^2+k(x-a)$$, but all that really proves that an equation with this form will satisfy it. I have no idea where to go from here, and to say that any equation following this form will work seems really flawed. Any help is appreciated.

Note that $$f(x) = (x-a)g(x)$$ for some $$g(x)$$ with degree $$1$$ less than $$f(x)$$. Also note that since $$\deg(f)\geq 2, g(x)= (x-a)h(x) + r$$ for some real $$r$$ and $$h(x)$$ with degree $$2$$ less than $$f(x)$$. Substituting back, we obtain:

$$f(x) = h(x)(x - a)^{2} + r(x - a)$$

Thus, $$f(x)$$'s remainder when divided by $$(x-a)^{2}$$ is of the form $$r(x-a)$$. $$\blacksquare$$

It follows from Euclidean division of polynomials (https://en.m.wikipedia.org/wiki/Polynomial_long_division) that

$$f(x) = (x - a)^2g(x) + r(x), \tag 1$$

where either

$$r(x) = 0 \tag 2$$

or

$$\deg r(x) < 2; \tag 3$$

in case (2), we take

$$n = 0, \tag 4$$

whence

$$r(x) = 0 = n(x - a) = 0(x - a); \tag 3$$

in case (3) we have

$$\deg r(x) \le 1, \tag 4$$

and thus $$r(x)$$ may be written

$$r(x) = \alpha x + \beta, \; \alpha, \beta \in \Bbb R; \tag 5$$

we evaluate (1) at

$$x = a, \tag 6$$

and obtain

$$f(a) = (a - a)^2g(a) + r(a) = r(a); \tag 7$$

since $$x - a$$ is a factor of $$f(x)$$,

$$f(x) = (x - a)h(x), \tag 8$$

for some

$$h(x) \in \Bbb R[x]; \tag 9$$

from (8),

$$f(a) = (a - a)h(a) = 0, \tag{10}$$

then (5), (7) and (10) together become

$$r(a) = \alpha a + \beta = 0, \tag{11}$$

so

$$\beta = -\alpha a, \tag{12}$$

and then

$$r(x) = \alpha x - \alpha a = \alpha (x - a), \tag{13}$$

which is of the requisite form with

$$n = \alpha; \tag{14}$$

that is,

$$f(x) = (x - a)^2g(x) + \alpha(x - a). \tag{15}$$

Let $$f(x)= (x-a)^2g(x)+ r(x)$$. Clearly $$deg(r)\leq 1$$ . Given $$(x-a)$$ divides $$f(x)$$. Therefore $$(x-a)$$ divides $$(x-a)^2g(x)+ r(x)$$. This implies $$(x-a)$$ divides $$r(x)$$. Therefore $$r(x)= n(x-a)$$ ( where $$n$$ is a real value ) as $$deg(r) \leq 1$$.