Finding inputs and outputs of a function from its graph