Define a function f such that f(f(n)) = -n for all non-zero integers n This challenge was inspired by a programming blog I frequent. Please see the original post here: A Programming Puzzle


Challenge
Define a function \$f:\mathbb{Q}\to\mathbb{Q}\$ such that \$f(f(n)) = -n\$ for all non-zero integers \$n\$, and where \$\mathbb{Q}\$ is the set of rational numbers.
Details
In whatever language you prefer, please define one function or program \$f\$ that accepts as parameter one number \$n\$ and returns or outputs one number \$f(n)\$.
Input may be provided through whichever mechanism is most natural for your language: function argument, read from STDIN, command-line argument, stack position, voice input, gang signs, etc.
Output should be a return value from a function/program or printed to STDOUT.
I would like to restrict answers to functions that do not take advantage of program state or global memory/data that is visible from outside of the function \$f\$. For example, keeping a counter outside of \$f\$ that counts how many times \$f\$ was called and just doing a negation based on this count isn't very challenging or interesting for anyone. The decisions \$f\$ makes should rely only on data within \$f\$'s lexical scope.
However, this restriction is probably inappropriate for some stack-oriented languages or other types of languages that do not distinguish these types of data or scopes. Please use your best judgement to keep with the spirit of this challenge.

Scoring
Standard code golf rules apply - your score is the number of bytes in your source code.
The minimal answer requires the domain and codomain of \$f\$ to be a subset of the rationals \$\mathbb{Q}\$. If you restrict your domain and codomain of \$f\$ to the integers \$\mathbb{Z}\$, then your score is the ceiling of 90% of the number of bytes in your source code.
Tiebreak
In the event of a tie, the following will be used in order:

Fewest number of printable non-whitespace symbols in your source code
Earliest date and time of answer submission


You are not required to support arbitrarily sized numbers. Please interpret the sets \$\mathbb{Z}\$ and \$\mathbb{Q}\$ as datatypes in your chosen language (typically integer and floating point, respectively).
If your solution relies entirely on the underlying structure or bit pattern of a data type, please describe its limitations and how it is being used.
Python: 61 34 30 29 27 points

f: Q -> Q

in math:

       | 0.5-x   if x is in Q \ Z
f(x) = |
       | x+0.5   if x is in Z


in Python:

f=lambda x:.5+[x,-x][x%1&gt;0]


tested with

filter(lambda n: n[0] != -n[1], map(lambda n:(n,f(f(n))),range(0,50)))


logic behind this:

When you take an integer n and put it into f you will get x+0.5. This is not an integer any more, so the next application will be 0.5-(x+0.5) which is -x.

Credits

Thanks to 


Bakuriu for striping it down from 61 characters to 34 characters.
Volatility for further reducing code size to 30 characters.
copy for reducing code size to 29 characters (and fixing a potential floating point problem).
aditsu for mentioning an inconsistency that came with the changes above.


Notes

First I thought this would be ok

f = lambda n: 1j*n


but its f:N->C and that is not allowed :-/