How to calculate gravity inside the star? Gravity must decrease due to less effective mass when going inside the object but also must increase with depth inside the star due to its higher density. Is there a model or formula approximating gravity calculations along the radius (from center to surface) of the stars?
 A: You need to know the equation of state for the star's interior. Once you know this you can calculate the density variation with depth and the gravity inside the star.
Google for something like "star equation of state" to find lots of articles on the subject, but note that it's exceedingly complicated because there are so many factors at work. This is the sort of article you'll find: good luck reading it!
Note also that while we can use models to calculate equations of state, the results are only as good as the models. It's hard to know how good our models are when all we can see is the surface of the star.
A: Here is an example for the Sun.
The figure below plots a (reliable) estimate for the interior density profile of the Sun, $\rho(r)$.
So for a given radius $a$, the mass interior to that radius is given by
$$ M(a) = \int^{a}_{0} 4\pi r^2 \rho(r)\ dr $$
And of course the gravitational field strength assuming spherical symmetry will be
$$g(a)  = - G M(a)/a^2$$
This would all usually be done inside a numerical model. But it is possible you could find a tolerably good analytic approximation to the curve below that might give you usable results. The profiles for stars of different mass or evolutionary stage will be similar, but different in detailed shape and central density.
An alternative would be to use the second picture which shows the run of pressure with radius inside the Sun. Hydrostatic equilibrium means that
$$ g(r) = -\frac{1}{\rho(r)}\frac{dP}{dr} $$
The data plotted comes from Bahcall and Pinsonneault (2004); the pictures were found at http://backreaction.blogspot.co.uk/2009/09/light-bulbs-and-solar-energy-production.html


