We have a real-valued function that obeys the functional equation f(x+y)=f(x)+f(y)∀x,y∈R.
First we find the values of f at positive integers. Put y=1 and x=k−1 (where k∈N) in the given relation:
f(k)=f((k−1)+1)=f(k−1)+f(1).
Because f(1)=2, this becomes
f(k)=f(k−1)+2.
Apply the same step repeatedly (mathematical induction):
For k=2: f(2)=f(1)+2=2+2=4.
For k=3: f(3)=f(2)+2=4+2=6.
We notice the pattern f(k)=2k. We justify it formally by induction: assume f(m)=2m for some integer m≥1, then
f(m+1)=f(m)+2=2m+2=2(m+1),
which completes the proof. Hence for every natural number k
f(k)=2k.
Now we examine the auxiliary function g(n) defined by the sum
g(n)=∑k=1n−1f(k),n∈N.
Substituting f(k)=2k gives
g(n)=∑k=1n−12k=2∑k=1n−1k.
We state the standard formula for the sum of the first m natural numbers: ∑k=1mk=2m(m+1). Here m=n−1, so
∑k=1n−1k=2(n−1)n.
Substituting this into the expression for g(n):
g(n)=2(2(n−1)n)=n(n−1).
The problem states that g(n)=20. Therefore we must solve
n(n−1)=20.
Expanding gives the quadratic equation
n2−n−20=0.
Factorising, we write
(n−5)(n+4)=0.
This yields two roots: n=5 and n=−4. Because n is a natural number, we discard the negative value and keep
n=5.
Hence, the correct answer is Option A.