Give an example of a function φ:R2R\varphi : \mathbf R^2 \to \mathbf R such that

φ(av)=aφ(v)\varphi(av) = a\varphi(v)

for all aRa \in \mathbf R and all vR2v \in \mathbf R^2 but φ\varphi is not linear.


Define

φ(v1,v2)={v1if v2=0v2if v1=00otherwise\varphi(v_1,v_2) = \begin{cases} v_1 &\text{if $v_2 = 0$} \\ v_2 &\text{if $v_1 = 0$} \\ 0 &\text{otherwise} \end{cases}

Clearly φ(av)=aφ(v)\varphi(av) = a\varphi(v) as it holds for each case, but

φ(1,0)+φ(0,1)=2φ(1,1)=0\varphi(1,0) + \varphi(0,1) = 2 \ne \varphi(1,1) = 0