Testing for function using the vertical line test