I believe that under the definitions from the answer given by M.V. Carriegos the following example works: the Ideal A in C[-1, 1] consisting of those functions g that vanish on the left semi-interval [-1, 0] and on the right semi-interval [0, 1] are of the form g(t) = t2f(t), where f(t) is a continuous function.This is an essential ideal, because its intersection with the ideal of functions vanishing on [0,1] consists of only zero function, but it is not a z-ideal. Of course, A is not a closed ideal.
Dear Doctor Vladimir Kadets, the definition of the z-ideals mentioned in the first solution is not accurate. You can see the attached paper for more details about the z-ideals.
I guess your example is a suitable one, thank you.
Every nonessential ideal is a relative z-ideal. Please see Proposition 2.8 in the attached paper. But need not be a z-ideal. For example, consider a non-zero-divisor f\in C(X) which Z(f) is not open, then the principal ideal (f) is a nonessential ideal which is not a z-ideal.
Thank you Dr Ali for your answer, I've answered the question with a good example in the attached file. Will you see the file please and till me what do you think?