On one hand, the graph of a function is by definition the set of $f$'s solutions: if $f:\mathbb{R}^m \rightarrow \mathbb{R}$ is a function, then the graph of $f$ is the set of solutions in the sense that it is the set
$$\Gamma(f) \equiv \{ \langle x, y\rangle \in \mathbb{R}^{m}\times \mathbb{R}^1\;:\; f(x) = y\}$$
On the other hand, you might be asking about a practical problem: suppose you've been given a graph, or you've been sketching a graph by plotting a few of its points. You believe that you've got the general gist of the graph—but how can you be sure? This is a deep question, with some good answers.
The first part of the answer is that we bring a lot of implicit assumptions when reading graphs. These assumptions are about the kind of functions that make sense, and that we realistically expect to see in certain settings.
For practical purposes, one common assumption is that functions are continuous and even differentiable/smooth to varying degrees. Other assumptions include that any function we plot will be made out of familiar, simple constituents such as polynomials and trigonometric functions.
In a technical sense, these assumptions may not hold: a mathematician could easily define a function that looks like $f(x) =x^2$ for all values of $x$ except for a small region where the function oscillates wildly. If you plotted that function, even over a wide region, you might be "tricked" into believing that it was a simple quadratic. An adversary could introduce arbitrarily many deviations which you would almost surely overlook.
But in practice, we are often plotting something like the result of a real physical process, or an idealized mathematical model made of simple functions. In these cases, we have good reason to suppose that the function conforms to our expectations and is not pathological in any unexpected way. Furthermore, from another point of view, we often have a purpose in mind, and within the tolerances of our application, it may be good enough to say that the function is a parabola, even if it isn't quite. So for example, if you know your function is smooth and you've plotted a fair number of points, you can just join up those points with line segments—your graph may not be exactly right, but the error might be within tolerance for your application.
The second part of the answer is that in addition to bringing in assumptions about the kind of functions we expect to see in our current application, we also often know a lot about the plotted function itself. For example, we might have a closed-form representation of it; if the function is built of elementary functions, we can scrutinize it to determine symbolically whether it has any peculiarities and where they might be. This is part of the usefulness of algebraic geometry. Or we might know how we got the function, which gives us reason to be sure that it is reasonably well-behaved.
That's how you can know that you've gotten the graph correct even when you've only plotted a few of the potentially infinitely many points on it.