I want to know why there are $4$ elements in $\mathbb{F}_2[x]/(x^2)$ and $25$ elements in $\mathbb{F}_5[x]/(x^2+3)$.
Suppose $\mathbb{F}_2=\{0, 1\}$ and $\mathbb{F}_5=\{0, 1, 2, 3, 4\}$.
I think my confusion roots from misunderstanding what exactly $(x^2)$ is. The definition I have is: \begin{equation*} (x^2)=\{rx^2\mid r\in\mathbb{F}_2[x]\}. \end{equation*} So $0\in(x^2)$? But $x\not\in (x^2)$? Then I guess elements of $\mathbb{F}_2[x]$ is: 1. $(x^2)$; 2. $x+(x^2)$; 3.$1+(x^2)$; 4.$x+1+(x^2)$. Hence there are $4$ elements. Am I right? But I have no idea how to enumerate elements in $\mathbb{F}_5=\{0, 1, 2, 3, 4\}$. Is there a logical way to count them up?
$\mathbf{F}_2[X]$ is the polynomial ring that consists of all $\sum_{i=0}^n a_i X^i$ where $a_i\in\mathbf{F}_2=\{0,1\}$ ($n\in\mathbf{Z}_{\geq 0}$).
In the quotient ring $\mathbf{F}_2[X]/(X^2)$ we "declare" $X^2=0$, hence it is clear that the only elements are polynomials of degree $\leqslant1$. Hence $\mathbf{F}_2[X]/(X^2)=\{0,1,X,1+X\}$.
For the second one: $X^2+3\in\mathbf{F}_5[X]$ is irreducible, since it is of degree $2$ and has no roots in $\mathbf{F}_5$. Hence $\mathbf{F}_5[X]/(X^2+3)$ is isomorphic to $\mathbf{F}_{5^2}$ which has $5^2=25$ elements.