My course problem booklet (mathematics BSc, second year module in algebra, unpublished) has a question (I paraphrase),
Prove that the operator $D:=x\frac{\text{d}}{\text{d}x}$ on $C^\infty(\mathbb{R},\mathbb{R})$ is linear.
The first half of the proof in the solution booklet has, \begin{aligned} D[f_1(x)+f_2(x)] & = x\frac{\text{d}}{\text{d}x}\left[f_1(x)+f_2(x)\right] && (1) \\ & = x\left(\frac{\text{d}}{\text{d}x}[f_1(x)]+\frac{\text{d}}{\text{d}x}[f_2(x)]\right) && (2) \\ & = x\frac{\text{d}}{\text{d}x}[f_1(x)] + x\frac{\text{d}}{\text{d}x}[f_2(x)] && (3) \\ & = D[f_1(x)] + D[f_2(x)] && (4) \end{aligned}
My question is about the step from (2) to (3). What sort of thing is $x$ that it can distribute over $\frac{\text{d}}{\text{d}x}[f(x)]$? For instance, is it a function in $C^\infty(\mathbb{R},\mathbb{R})$? Is it an operator in $L(C^\infty(\mathbb{R},\mathbb{R}))$?
Let $V=C^{\infty}(\Bbb{R},\Bbb{R})$; this is a vector space over $\Bbb{R}$ (I hope you've already justified this). The definition of $D$ is that for each $f\in V$, $Df:\Bbb{R}\to\Bbb{R}$ is the function defined as $(Df)(x):= x\cdot f'(x)$. The usual calculus rules tell us that $Df\in V$, hence $D$ is a mapping $V\to V$. The question is whether it is linear, i.e if for all $c\in\Bbb{R}, f_1,f_2\in V$, we have $D(cf_1+f_2)=cD(f_1)+D(f_2)$? The answer is yes. Why? This is a question about functions, and equality of functions is defined pointwise. So fix any $x\in\Bbb{R}$. Then, \begin{align} [D(cf_1+f_2)](x)&= x\cdot (cf_1+f_2)'(x)\tag{i}\\ &=x\cdot \left(cf_1'(x)+f_2'(x)\right)\tag{ii}\\ &= c\cdot x\cdot f_1'(x)+ x\cdot f_2'(x)\tag{iii}\\ &= c\cdot D(f_1)(x) + D(f_2)(x)\tag{iv}\\ &=[c\cdot D(f_1)+ D(f_2)](x)\tag{v} \end{align}
Finally, looking at (v), notice that we have proved this for all $x\in\Bbb{R}$, so by definition of equality of functions, $D(cf_1+f_2)=cD(f_1)+D(f_2)$. Finally, since $c\in\Bbb{R}, f_1,f_2\in V$ were arbitrary, this shows $D:V\to V$ is indeed a linear transformation.