Q:

Can I find quadratic function when Im being given x and y values? 

I was doing an algorithm where Im given x and y solution, and I need to find if possible, quadratic formula for that solutions. 
What I actually mean is:
If Im given output:
f(1) = 1 
f(2) = 5
f(3) = 13
f(4) = 25

So, the function should return 1,5,13,25
Function that gives that output is: 2x^2-2x+1, but how do I get that? 

A:

If your y-values are precise, you can solve system of linear equations
a*x1^2 + b*x1 + c = y1
a*x2^2 + b*x2 + c = y2
a*x3^2 + b*x3 + c = y3

substitute known values for three points and find unknowns coefficients a,b,c
If values are approximate, use least squares method (more precise - polynomial least squares) with all points

