No, you cannot run it in reverse if you are going to get an answer using a quantum computer. Even though the intermediate step with quantum gates are reversible. It can be easily understood by the following general quantum algorithm:
- Preparing an initial state $\left|\psi\right\rangle$
- Get the final state $\left|\phi\right\rangle = U\left|\psi\right\rangle$ with a big unitary operator $U$
- Measure the state $\left|\phi\right\rangle$
The physical measurement in step 3 is obviously not reversible since the final state is now collapsed to a particular value. This value cannot be used to reconstruct the state $\left|\phi\right\rangle$ and so the whole computation is not reversible.
If there is an algorithm such that both states $\left|\psi\right\rangle$ and its answer $\left|\phi\right\rangle$ are not in superposition state, we can certainly construct the state and run the reverse of $y=f(x)$. However, in this case you dont need a quantum computer, you just need a classical computer with all quantum gates replaced by classical gates.
Note that the step 2 can be reversed $\left|\psi\right\rangle = U^{-1}\left|\phi\right\rangle$, but it is not useful. In most algorithm, the initial state $\left|\psi\right\rangle$ is some kind of uniform superposition of all possible state to gain the power of "parallel processing". You definitely dont want to run it in reverse, because you already know the initial state.
Actually, most function are not trivial invertible. You should not only look for those algebraical function and continuous function, which only form a tiny subset of all possible function. In computer science, they are usually considering the function $f:\{0,1\}^n \to \{0,1\}$ which has total number of $2^{2^n}$ functions. For a simple example, lets consider the following permutation map $g:\{1,2,3,4\}\to\{1,2,3,4\}$
$$f(1)=3, f(2)=1, f(3)=4, f(4)=2$$
In this example, you should see that it is not possible to figure out the inverse mapping until you go through all 4 possible values.