Let the extension be E and the tension be T.
Then E∝T
E=kT
when T = 8N, E = 2cm
2=k×8
k=28=0.25
∴E=0.25T
when T = 12N, E=0.25×12=3cm