How do you define a non-integer as even or odd? Note that in this question, I will use the word non-integers to mean all rational non-integers.
I've been working on problems on non-integers lately, and a few thoughts popped into my head.

How do you define non-integers as even or odd?


How do you define non-integers as prime or composite?

I thought of some of the possibilities. Do you round to the nearest integer and define parity on that? Do you take away the decimal point to find primes and composites? Or are non-integers described as neither even or odd, neither prime or composite?
Any help on this would be appreciated greatly.
 A: Disclaimer: In this answer I mostly focus on prime numbers, i.e. the second question of the orignal post. Only in the end I will return to the question about odd or even. This bit is not connected to the concepts introduced before. Please do not confuse the concept or prime numbers and unique factorization with the concept of parity.
Many people have wondered about these questions in abstract algebra already. What makes a number even, what makes it odd? What is the property that will define prime numbers?
But even more importantly: What would the concepts help us with?
Let's begin with primes numbers and the concept itself. Prime numbers are the multiplicative building blocks of any integer. For example $28=2\cdot 2\cdot 7$, where $2$ and $7$ are both prime numbers. This decomposition is, as you will probably know, mostly unique - in fact, since the multiplication on the integers is commutative, the order of the factors does not matter at all. We could do the following though: $28=(-2)\cdot 2\cdot (-7)$. Here both $-2$ and $-7$ are also prime - if we didn't allow negative numbers to be prime, then we couldn't build negative numbers as products of primes.
So the question becomes: What is the difference between the two representations of $28$? Are $2 $ and $-2$ fundamentally different? Turns out, they're not. What makes them similar? Well, for a start: $-2=(-1)\cdot 2$. So, what is special about $-1$ as an integer? We have to look at a different number first: $1$. We know that the number $1$ is actually really special, since $1\cdot n=n$ for every integer $n$. So multiplication with $1$ doesn't change anything. That's cool.
Now back to $-1$. Why is $-1$ special? Well - Except for $1$, the integer $-1$ is the only integer, which can be multiplied by a different integer to give us $1$ - in a formula:
$$(-1)\cdot x=1$$
can be solved for $x$. In particular, $x=-1$. Now you might try to argue that $2x=1$ can also be solves, solution would be $x=1/2$, but here $x$ is not an integer anymore. So, $-1$ is indeed special. These numbers, that can be multiplied by something to give $1$ are called units. In the prime decomposition, mutiplying by units doesn't give us fundamentally different primes - in fact we call $2$ and $-2$ associated primes, because we can reach one of the two by multiplying the other with a unit.
Our uniqueness result is now more precise: If we don't care about units ($-1$ or $1$), then the decomposition is unique up to associated primes.
Great! We found a really useful result for primes. We have one problem remaining though. What about the units? Does $1$ have a unique representation as a product of primes? Does $-1$? Well, here mathematicians did something weird at first glance: We define an empty product. A product over no factors. This is simply defined to be $1$. So, the uniqueness even works for units, but unfortunately not as pretty. We say
$$28=2^2\cdot 7\\
12=2^2\cdot 3\\
-45=3^2\cdot (-5)\\
1=2^0\cdot 3^0\cdot 5^0 \cdots.$$
This gave us a great idea what prime numbers do. And we can now try to define prime numbers on the rationals. First we remember that units are weird and cannot be primes, they are different. So let's figure out the units of the rational numbers.
Well, $1$ is still the same. Now we wonder: For which rational number $q$ is the equation $q\cdot x=1$ solvable over the rational numbers? First of all, $0$ doesn't work, we don't consider $0$ for multiplicative purposes (because $0\cdot x=0$ for all $x$). But then I can simply define
$$x=\frac{1}{q}\implies q\cdot x=1.$$
But then $q$ is a unit. But $q$ was any non zero rational number. So in fact, non zero rationals are units? Yes. We call this a field. Over a field the concept of primes doesn't make any sense, since we can't have multiplicative building blocks.
The same problem arises with odd and even: What makes an integer even? The fact the we can divide by $2$ and still be an integer. $3$ is not even, because $2x=3$ is not solvable over the integers, but $4$ is even, because $2\cdot 2=4$, because $2\cdot x=4$ is solvable over the integers.
What happens over the rationals though? There $2x=q$ can always be solved for any given $q$. Same thing for numbers divisible by $3$ - $3x=q$ can be solved by taking $x=q/3$. So the concepts of odd and even don't really make any sense over the rationals.
You did have a few ideas though. First of all - ideas are great, don't be discouraged by this. The ideas might actually be valid definitions for those concepts. But valid doesn't always mean useful. What do we want to do with the concept of primes closest to the rational number? What things could be done here? Is there anything we could get from that idea? If you find something, great - your definition is actually very fruitful. If not though, you might want to try to find a different concept to generalise.
I hope this was at all helpful.
