Does having publications on a completely separate field helps my graduate school application? I am currently a mathematics undergraduate with every intention to enter a top mathematics PhD program in the future. I understand that having research experiences as an undergraduate is one of the key aspects of making your applications sufficiently strong to be considered, and as such, I have participated/am participating in a couple of undergraduate research projects.
Here is the problem: While I have been interested mostly in number theory/analysis in my earlier days as an undergraduate, only recently have I realised that I'm most interested in set theory. I have completed one undergraduate research on number theory (not publishable but was published on a small, local mathematical journal), and am currently participating in a project related to PDE, which is very heavy on functional/nonlinear analysis (this project is expected to lead to a publishable article). As one can tell, these two projects have completely no relation to set theory. I also have one final project to undertake, which is my final year project, and I intend to research on set theory on this project.
Should I ultimately decide to apply for PhD under the set theory/logic department in the future, how much would my past research experiences in other fields help in my application?
I appreciate any advice provided.
Should I ultimately decide to apply for PhD under the set theory/logic
department in the future?

It's up to you. Nothing you have said indicates that you should not pursue your dream.

How much would my past research experiences in other fields help in my
application?

A lot.
When I read the title, I thought it was going to be that you're applying to mathematics but published in biology, or something like that.  After reading the question I've learned that you've published a number theory paper in a small local journal, and may publish a paper heavy in functional analysis, and you want to apply for a PhD in set theory/logic. These aren't &quot;completely&quot; different fields, they are all mathematics subjects and there is always some overlap.
Having a publication, no matter what the field, does show at least a bit of aptitude for research, and that you have experience in academic research and publishing. Not all undergraduate students that get into prestigious PhD programs have publications (though it certainly would help). Even fewer will have a publication in precisely the same field as their PhD.