Graph (mapping)/R to R/Injective and surjective/Exercise

How can we recognize by looking at the graph of a mapping

whether is injective or

surjective?