Answer
This is a function.
Work Step by Step
A function is a correspondence between a first set, called the domain,
and a second set, called the range,
such that EACH member of the domain corresponds to EXACTLY ONE member of the range.
---
Keywords are emphasized.
We see from the graphical definition of the function that
EACH input from the domain has an arrow pointing from it to a value in the range.
and
only ONE arrow originates from each member of the domain.
This is a function.
NOTE: A misconception that some people have is that,
because there are two incoming arrows into 2,
they conclude that this is not a function.
But,
f(a)=2, a is awarded one and only one value from the range.
f(b)=2, b is awarded one and only one value from the range.
No problems here, this is a function.