construct a function whose level curves are lines passing through the origin.
i don't know how to express this function...can anyone help? is the center have to be 0,0 but i don't know how to write this...
Maybe I am misunderstanding the question, but isn't the OP looking for a function such that $\displaystyle f(x,y)=c$ is linear and passes through the origin? So if your function was correct we would have that
$\displaystyle cx^2+cy^2=2xy$ which is not even a function let alone one that is linear.
Solve $\displaystyle cy^2 - 2xy + cx^2 = 0$ using the quadratic formula. You get solutions of the form y = mx where m is a function of c. There is only a certain set of values of c for which these lines exist. No level curves exist for values of c lying outside of these values.
Note: c = 0 gives the level curves x = 0 and y = 0 (which obviously pass through the origin).
Clearly this example is one of an infinite number of possibilities. I can only hope the OP has not been discouraged from contemplating it as a solution to his/her problem.
Of relevance is the general Cartesian equation of a conic, viz.
$\displaystyle ax^2 + 2{\color{red}c}xy + {\color{red}b}y^2 + 2dx + 2ey + f = 0$.
(I have switched the standard notation slightly [see red] to be consistent with the example I gave).
It defines a hyperbola, a parabola, an ellipse, a circle or a pair of lines depending on the value of the invariants of the curve.
A little bit of research should show origins of the example I gave.