Give a concrete example: f is continuous in [a, b], (a, b) is derivable, and f'(x) constant is equal to m, which proves that f is a linear function in [a, b].
The most direct and rigorous proof is to use the mean value theorem:
Let c belong to (a, b), any x belongs to (a, b), f (x)-f (c) = f' (t) (x-c) = m (x-c), that is, f is a linear function.