How to tell if a graph is a function in algebra