For compton scattering, electron needs to be free from any surrounding electric field. But electrons in graphite are bound to graphite. I have two doubts, first, if electrons are free in graphite, why don't they leave graphite, second if there is some force binding them, why do they show Compton scattering?
[Physics] Free electron and compton scattering
quantum mechanicsscattering
Related Solutions
The key point here is that in quantum mechanics, all forces are conservative - that is, they all preserve the law of conservation of energy exactly and absolutely. You should expect this to make sense, because all forces that in our every-day experience appear to be "non-conservative", like friction, are really just the manifestations of conservative forces acting on a microscopic scale. Quantum mechanics is the physics of that microscopic scale, and its mathematical formulation bears witness to this fact with exactly what you have described.
In classical mechanics, a conservative force is defined as a force field which conserves energy - meaning you can take a particle in and responsive to that force field, move it around a closed circuit in space, and you will end up with no more and no less energy when you finished as when you started. Mathematically, that means
$$\mbox{Work done (energy released)} = \oint_{\gamma} \mathbf{F} \cdot d\mathbf{l} = 0$$
where $\gamma$ is some closed loop, and $d\mathbf{l}$ is just a tiny vectorial increment of length therealong representing a little piece of motion. Using some theorems of vector calculus, you get that it is then possible to describe the force field $\mathbf{F}$ as the gradient of a scalar function (i.e. one returning only a number), $U$:
$$\mathbf{F} = -\nabla U$$
and this function $U(\mathbf{r})$ has the dimensions of an energy, and is what we call the potential energy. This $U$ is what is typically (oddly) denoted $V$ in many quantum mechanics texts. Because all forces are conservative like this on the scale in which we use quantum theory, we can effectively ditch the force $\mathbf{F}$ specifically as redundant and work only with the potential energy function $U$, and when one goes deeper still, one finds this makes more sense because really, energy is the more fundamental physical quantity than force.
If the force $\mathbf{F}$ is zero, then you must have $\nabla U = 0$, and it is easy to see that means $U$ is constant. In other words, yes, you can apply the reasoning you give, though with the caveat that the force in question need not be electric. An electron being sucked into at least a Newtonian gravity well is entirely treatable the same way - just assign $U(\mathbf{r}) := -\frac{GMm_e}{r}$.
Now if your suspicion about classical reasoning is that we still have a classical-looking potential energy function and that the intuition behind it is still based on the classical notion of force, you are right! In fact, to fully treat force fields quantum-mechanically, we need quantum field theory - which constitutes the basis of the very best theories we have for understanding the basic constituents of our Universe.
Best Answer
If we are doing a calculation based on the equation for the Compton effect we assume that any other interactions with the electron are negligible compared with the energy transferred between the photon and the electron. At visual wavelengths, i.e. energies of a few eV, this requires that the electron be almost completely free so it only works for an isolated electron.
However if we are doing Compton scattering with X-rays then the energies exchanged are in the keV range and vastly greater than typical electron binding energies in atoms. That means that when considering Compton scattering by X-ry photons we can treat even the electrons in atoms as though they were free.
You don't say exactly what is going on in your experiment, but if the electrons involved are the conduction electrons then the binding energy will be about the work function of graphite, which is around 4eV. For Compton scattering by any photon of an energy much greater than 4eV it is a good approximation to treat the electron as free.