What is the difference between a function and a curve?
I think that the most general definition of ''curve'' that correspond to our intuition is:
A curve is a continuous function $\gamma: I \to X$ where $ I \subset \mathbb{R}$ is an interval and $X$ is a topological space.
So, every curve is a function, but this does not means that, If $X= \mathbb{R}^2$ than any curve can be expressed as a function $f:\mathbb{R} \to \mathbb{R} \qquad y=f(x)$.
In this case, as you notice, a circle is a curve, but we have not a single function $f:\mathbb{R} \to \mathbb{R} $ such that the points of the circle are the graph of $f$.
But note that these points $P=(x,y)$ on the circle can be represented as the domain of a function $f:[0,2\pi) \to \mathbb{R}^2$ as $f(t)=(\cos t,\sin t)$.
Given two spaces, $X$ and $Y$, a function $f$ is a relation from $X$ to $Y$ such that there exists exactly one $y\in Y$ for every $x\in X$ such that $(x,y)\in f$. Written another way, $f(x)=y$. If $f(x)=y_1$ and $f(x)=y_2$ then $y_1=y_2$.
In terms of our usual functions from $\mathbb{R}$ to $\mathbb{R}$, the above condition says that it should pass "the vertical line test." If we were to take a pencil, and move the pencil from left to right perpendicular to the $x$ axis, at each point in time it will cross the graph of the function at exactly one point. (no more than one and no fewer than one).
Curves on the other hand are more general. Most (if not all) curves can be defined as a function from $[0,1]$ to $X\times Y$ (at least these are the only useful curves in my opinion). $f(t)=(f_1(t),f_2(t))$. For example, the unit circle can be described by the curve $f(t)=(\cos(2\pi t),\sin(2\pi t))$.
Often-times we can choose to ignore what values of $t$ generate the specific outputs and refer simply to the image of such a function as the curve.
In this definition, we do not disallow there to be $x$ values which have multiple $y$ values associated with it. I.e. it might fail the vertical line test.
Special types of curves exist such as closed curves (when $f(0)=f(1)$), simple curves (when $f(t_1)\neq f(t_2)$ for all $t_1\neq t_2$), etc...
Read more here.