For full disclosure, this was a problem I saw on glassdoor that was supposedly asked in an interview. I hope it's OK to ask here; I am not being asked to solve this, I just thought it was a very interesting problem.
I am not sure if the problem was exactly posed as stated in the title, so I make some clarifications: (i) Assume the function definitely takes $0$ for some value in the domain. (ii) When we say "we only know $y$ when given $x$", I think we can treat the function as if it is some sort of oracle, telling you its value at that point in the domain. But we don't have an explicit function.
I can't even see how this is necessarily solvable as stated. I just don't see how finite (or even countable) sampling of a continuous function will guarantee our ability to find the zero. Especially since the function is arbitrary, we could end up with pathological functions that mean some clever approach would fail. The usual computational methods I am aware of such as Newton's method, bijection, Secant etc. all don't work.
I am quite baffled, can anyone please give me some hint or mathematical way of approaching this?
You can't find a unique function under such conditions without a second point or without the graph. There could be hundreds of functions that might yield the same $y$ at the same $x$ as in your question.
However, if some conditions are added as hints as in here, you can do at least something algebraic to get hold of a possible function.