My question is to show there is no sentence $\psi$ in a language of first order logic without any non-logical symbols such that for every finite structure $\mathcal{A}$: $$\mathcal{A} \vDash \psi \; \text{if and only if} \; | \mathcal{A} | \; \text{is even}.$$ Is there such a sentence $\psi$ if we add a unary function symbol $f$ to our language?
My attempt at a solution:
For the first part, suppose for contradiction there is such a $\psi$. Let $\Gamma = \{ \lnot \gamma _n : n \ge 0\}$ where $\lnot \gamma _n$ expresses there are 2n+1 objects.
Now let $\mathcal{A}$ be a structure such that $\mathcal{A} \vDash \Gamma$.
If $\mathcal{A}$ is finite, then $| \mathcal{A} |$ is even and so $\mathcal{A} \vDash \psi$.
We know $\{ \psi \}$ is consistent, since every finite, even structure is a model of $\{ \psi \}$. So by Lowenheim-Skolem theorem, $\{ \psi \}$ has a countable model, $\mathcal{B}$ say. So $\mathcal{B} \vDash \psi$.
So if $\mathcal{A}$ is infinite, then $\mathcal{A} \vDash \psi$ as $\mathcal{A}$ and $\mathcal{B}$ are equivalent(?).
Therefore, $\Gamma \vDash \psi$. So by compactness there is $\Gamma _0 \subset \Gamma$ finite such that $\Gamma _0 \vDash \psi$. This is a contradiction as we can easily find a model $\mathcal{C}$ of $\Gamma _0$ for which $\mathcal{C} \vDash \Gamma _0$ but $\mathcal{C}$ does not model $\psi$ : any model of cardinality $2k+1$ where $k$ is chosen greater than the index of any $\gamma _n$ occurring in $\Gamma _0$ will do. Thus, there is no such $\psi$.
Is the above method correct? I am unsure about the case when $\mathcal{A}$ is infinite and applying the Lowenheim-Skolem theorem. I also have no idea on the second part of the question. Any help would be appreciated. Thanks
We show that there if our language $L$ has (among perhaps other symbols) a unary function symbol $f$, then there is a sentence $\varphi$ with the following properties. (i) For every positive even integer $n$ there is an $L$-structure $A$ whose underlying set has cardinality $n$ and in which $\varphi$ is true and (ii) There is no odd positive integer $n$ such that $\varphi$ is true in a structure of cardinality $n$.
For example we can let $\varphi$ be the sentence $$\forall x(\lnot(f(x)=x)\land (f(f(x))=x)).$$
Added: Now that it has been added that the language for the first question has no non-logical symbols, we can make a few comments. Lowenheim-Skolem is not needed. Compactness shows that any sentence $\varphi$ which is true in finite sets of arbitrarily high cardinality is true in all sets.