Difference between a function and a graph of a function? Formally, I learned that a function $f: X \to Y$ is a subset $f \subset X \times Y$ subject to the condition that for every $x \in X$, there is exactly one $y \in Y$ such that $(x, y) \in f$. We write $y = f(x)$.
The graph of a function $f: X \to Y$ is the set $\{(x, f(x)) : x \in X\}$.
Based on these two definitions, the graph of a function is, well, just the function (i.e $\operatorname{graph} f = f$), which makes me wonder why would you consider the "graph" of a function if it doesn't tell you anything new?  

Consider the following two functions: $f:\mathbb R \to \mathbb R$, $f(x)=\sin(x)$, and $g:\mathbb R \to [-1,1]$, $g(x)=\sin (x)$. As functions, these two things are different simply because the codomain of one is different than the codomain of the other. However, since for all $x\in \mathbb R$ it holds that $f(x)=g(x)$, the graphs of both functions are identical. 
Some aspects of a function are completely determined just by the graph, but some are not. For instance, injectivity of a function is completely determined by its graph, while surjectivity does not. I.e., $f$ above is not surjective, while $g$ is surjective. 
When thinking of a function as a process it is natural to specify its domain (thought of as possible inputs) and its codomain (possible outputs) without committing oneself that every output really is attained. Here is an extreme example. Let $f:\mathbb R \to \mathbb R$ be given by $f(x)=e^{\sin(x)}\cdot\cos(x)$. I just defined the function without worrying about its precise image, which could be a pain to figure out if all I want to do is define the function. 
