Non-commutative ring (not necessarily with multiplicative identity) of order $n$ exists if and only if $p^2|n$ for some prime $p$? Is it true that there is a non-commutative ring (not necessarily with unity) of order $n$ if and only if $p^2\mid n$ for some prime $p$ ?
 A: Yes, this is true. 
Part 1: Each ring $R$ (either with or without identity) of square-free order is commutative. 
For, let the order be $n=p_1 \cdots p_h$ with $p_i \neq p_j$ for $i \neq j$. By applying the structure theorem of finite abelian groups to $(R,+)$, we find $R \cong \mathbb{Z}/{p_1} \oplus \cdots \oplus\mathbb{Z}/_{p_h} \cong \mathbb{Z}/n$ (Chinese Remainder theoem) as additive group. 
So there is $\sigma \in R$ such that each $r \in R$ can be written as $r = \sigma + \cdots + \sigma =: k\sigma$ (k summands). Hence by distributivity (d): 
$$\sigma \cdot r = \sigma \cdot (\sigma + \cdots + \sigma)\overset{(d)}{=}
(\sigma \cdot \sigma) + \cdots + (\sigma \cdot \sigma)\overset{(d)}{=}(\sigma + \cdots + \sigma)\cdot \sigma=r \cdot \sigma.$$
Now we can proceed by induction (I): Suppose $(k\sigma)r=r(k\sigma)$ for $k \ge 1$ and any $r \in R$. Then 
$$((k+1)\sigma)r = (k\sigma +\sigma)r\overset{(d)}{=}(k\sigma) r + \sigma r\overset{(I)}{=}r(k\sigma) + r\sigma\overset{(d)}{=}r((k\sigma + \sigma)=r((k+1)\sigma)$$
So, by induction, $(k\sigma)r=r(k\sigma)$ for all $k \ge 1, r \in R$. But because each $s \in S$ is of the form $s=k\sigma$ for some $k \ge 1$ we have $sr=rs$ for all $r,s \in R$, i.e. $R$ is commutative. 
Note: The multiplicative structure is given by a relation $\sigma^2 = \ell \sigma$ for $1 \le \ell \le n$. $R$ has an identity iff $\ell$ is coprime to $n$ in which case $R \cong \mathbb{Z}/n$ (as rings). 
Part 2: If $n$ isn't square-free, write $n=p^2m$ for some prime $p$. There is a non-commutatative ring $S$ of order $p^2$: $\,S = \mathbb{F}_pa \oplus \mathbb{F}_pb$ with multiplicative relations $a^2=a, b^2=b, ab=a, ba=b$ (this is ring E in Theorem 2 of the paper https://www.maa.org/sites/default/files/Classification_of_Finite-Fine04025.pdf). 
Now the product ring $R := S \times \mathbb{Z}/m$ is non-commutative of order $n$. 
