Find a first order sentence satisfied by models with square domain. 
(c) Let $\mathcal{L}^*\subseteq\mathcal{L}^{\text{FOPC}}$ be a first order language of predicate calculus consisting of three unary function symbols $f,g,h$.

*

*(i) Write down an $\mathcal{L}^*$-sentence $\phi$ such if $\mathcal{A}$ is an $\mathcal{L}^*$-structure with $\mathcal{A}\vDash\phi$ then the restriction of $h_\mathcal{A}$ to the range of $f_\mathcal{A}$ gives a one-to-one function onto the range of $g_\mathcal{A}$.


*(ii) Write down an $\mathcal{L}^*$-sentence $\psi$ such that if $\mathcal{A}$ is an $\mathcal{L}^*$-structure with $\mathcal{A}\vDash\psi$ and the domain $A$ of $\mathcal{A}$ is finite then the cardinality $|A|$ is a square.

Part (i) is easy enough, but I'm having trouble with part (ii). I assume that you can use part (i). My initial idea was to use $h$ to ensure $|Range(f_A)| =|Range(g_A)|$ but I'm not sure where to go from there.
Thanks.
 A: Think of $A$ as $F\times G$, where $|F|=|G|$, and think of $f$ and $g$ as being the projection maps from $A$ to $F$ and to $G$, respectively. That $|F|=|G|$ is, as you noted, captured by $\varphi$. For the rest, note that in this setting each element of $A$ is uniquely identified by the pair $\langle f_{\mathcal{A}}(a),g_{\mathcal{A}}(a)\rangle$: two different elements of $A$ cannot have the same pair of $f$ and $g$ values. Just turn this into an $\mathcal{L}^*$-sentence.
A: For the problem as (badly) stated, you could just take the sentence
$$\forall x\forall y[x=y]$$
which says that the universe has just one element, or the sentence
$$\exists w\exists x\exists y\exists z\forall t[w\ne x\land w\ne y\land w\ne z\land x\ne y\land x\ne z\land y\ne z\land(t=w\lor t=x\lor t=y\lor t=z)]$$
which says that there are exactly $4$ elements, etc. Of course the intended problem was to find a sentence which has a model of cardinality $n$ if and only if $n$ is a square. For that you can simply take the conjunction of the following two sentences:
$$\forall x\forall y[f(x)=f(y)\land g(x)=g(y)\implies x=y]$$
$$\forall x\forall y\exists z[f(z)=g(x)\land g(z)=f(y)]$$
Note that the second sentence implies that $f$ and $g$ have the same range.
