All the squares of a board of $(n+1)\times(n-1)$ squares
are painted with [b]three  colors[/b] such that, for any two different
columns and any two different rows, the 4 squares in their
intersections they don't have all the same color. Find the
greatest possible value of $n$.
To solve the problem, we need to find the greatest possible value of \( n \) such that a \((n+1) \times (n-1)\) board can be painted with three colors in a way that no four squares forming a rectangle have the same color. 

1. **Understanding the Problem:**
   - We need to ensure that for any two different columns and any two different rows, the four squares at their intersections do not all have the same color.
   - This is equivalent to saying that no four corners of any rectangle formed by the grid have the same color.

2. **Generalizing the Problem:**
   - Suppose there are \( p^k \) colors. We can build a grid of size \((p^k)^2 \times (p^k \cdot (p^k + 1))\) without a rectangle with monochromatic corners.
   - Consider the vector space \(\mathbb{F}_{p^k}^2\) (the space of dimension 2 over the field with \( p^k \) elements).

3. **Constructing the Grid:**
   - Each row corresponds to one of the vectors in \(\mathbb{F}_{p^k}^2\).
   - Each column corresponds to a coloring of all the vectors using \( \mathbb{F}_{p^k} \) colors.
   - There are \( p^k + 1 \) lines that pass through the origin. Each such line \( L \) gives us \( p^k \) columns.

4. **Coloring the Grid:**
   - Look at the lines parallel to \( L \); they partition the entire space. Label the \( p^k \) parallel lines as \( l_1, l_2, \ldots, l_{p^k} \).
   - The \( i \)-th coloring that corresponds to \( L \) paints the vectors of line \( l_j \) with color \( i + j \).

5. **Verifying the Construction:**
   - To check that this works, pick two columns and a color \( c \). We need to ensure that the vectors of color \( c \) in the first column and the second column share at most one vector.
   - These sets are two lines in a vector space, and they intersect at most at one point unless the two lines are the same, which is never the case.

6. **Applying to the Given Problem:**
   - For the case \( 10 \times 12 \), we have \( p^k = 2^1 \). This means we are using 2 colors.
   - The grid size is \( (2^1)^2 \times (2^1 \cdot (2^1 + 1)) = 2^2 \times 2 \cdot 3 = 4 \times 6 \).

7. **Finding the Greatest \( n \):**
   - We need to maximize \( n \) such that \( (n+1) \times (n-1) \) fits the criteria.
   - For \( p^k = 3 \), we have \( 3^2 \times 3 \cdot 4 = 9 \times 12 \).
   - Therefore, the greatest \( n \) is when \( n+1 = 9 \) and \( n-1 = 12 \), which is not possible since \( n+1 \) and \( n-1 \) must be consecutive integers.

8. **Conclusion:**
   - The greatest \( n \) that fits the criteria is when \( p^k = 2 \), giving us a grid of \( 4 \times 6 \).
   - Thus, \( n+1 = 4 \) and \( n-1 = 6 \), which implies \( n = 5 \).

The final answer is \( \boxed{5} \).