We are given that $\displaystyle \int^1_0 (ax+b)f(x) dx =0 .$ Suppose $f$ is not identically zero for otherwise the result is trivial. The condition $\displaystyle \int^1_0 f(x) dx = 0 $ implies there is at least one sign-changing root, say at $ m$ (that is, the function has different signs after passing through $m$, or more formally, $f(m+\epsilon)f(m-\epsilon)< 0 $ for all sufficiently small \epsilon>0.) Suppose this is the only sign-changing root. Then $ (x-m)f(x) $ does not change signs and is not identically $0$ either, so $\int^1_0 (x-m) f(x) \neq 0 $, contradicting the first statement. Thus there are at least $2$ distinct sign-changing roots.
This idea can be employed in proving the generalized result: If $ f\in C( [0,1], \mathbb{R} ) $ is such that $ \displaystyle \int^1_0 x^k f(x) dx = 0 $ for all $ k= 0, 1,2,\cdots, n-1 $ then $f$ has at least $n$ distinct sign-changing roots in $[0,1].$