To find the contrapositive, you negate the hypothesis and the conclusion of the statement, and then switch their positions in the statement such that the conclusion becomes the hypothesis and vice versa:
If two variables are directly proportional, then their graph is a linear function.
If two variables are not directly protional, then their graph is not a linear function.