sol=DSolve[x*v[x]*v'[x]+(v[x])^2==g*x,v[x],x]

v2[x_]=sol[[2,1,2]]/.{C[1]->-2/3*10, g->10}

Plot[v2[x],{x,1,10},AxesOrigin->{0,0}]