Step 1: Understanding the Concept
The equation is homogeneous in \(x\) and \(y\), so substitute \(x=vy\).
Step 2: Substitute
Then \(dx=v\,dy+y\,dv\). The equation \(y\sec^{2}\left(\dfrac xy\right)dx=\left(x\sec^{2}\left(\dfrac xy\right)-y\right)dy\) becomes
\(y\sec^{2}v\,(v\,dy+y\,dv)=(vy\sec^{2}v-y)dy\).
Step 3: Separate
\(y^{2}\sec^{2}v\,dv=-y\,dy\), so \(\sec^{2}v\,dv=-\dfrac{dy}{y}\).
Step 4: Integrate
\(\tan v=-\log|y|+c\), so \(\tan\left(\dfrac xy\right)+\log|y|=c\).
Hence \(g(y)=\log|y|\).
Final Answer:
The function g(y) is log of the modulus of y.
\[ \boxed{\text{(A) }\log|y|} \]