You are not quite correct that $f(x)=(x−λ_1)(x−λ_2)...(x−λ_n)$. The problem is that you've already stated that $n$ is the dimension of the space, so that statement would only hold when there are $n$ distinct eigenvalues. The correct statement is that $f(x)=(x−λ_1)(x−λ_2)...(x−λ_m)$, where $m$ is some number between $1$ and $n$. However, it is still not true that each of the $\lambda_i$ must be distinct.
As ajotatxe notes, one classic example is the matrix $B =\begin{pmatrix}0&1\\0&0\end{pmatrix}$. Note that $B$ has only $0$ as an eigenvalue. Recall that the minimal polynomial will be the smallest degree polynomial $f$ such that $f(B) = 0$. But if we take $f(x) = x$, as there is only one eigenvalue, then that would mean $f(B) = B = 0$. But obviously this is false. $B \ne 0$.
So instead, we have to try higher combinations. Fortunately, since $0$ is the only eigenvalue, all we have to do is keep raising $B$ to higher powers until we get $0$. And sure enough $B^2 = 0$, which means $f(x) = x^2$ in this case.
In your more general case, what you need to do is show that some power of $A$ must be $0$. As I am not sure what tools you currently have, I cannot be sure the best way to suggest doing this. If you have discussed the characteristic polynomial $p$ and the Cayley-Hamilton theorem, then this should be easy, as the characteristic polynomial for $A$ will be $x^n$.
One other issue. You seem to be confused by the "leading coefficient of 1" condition. This is just a minor technicality. I said above that the minimal polynomial is the polynomial of smallest degree such that $f(B) = 0$. But there are actually infinitely many such polynomials. The minimal polynomial was $f(x) = x^2$, but if $a$ is any non-zero number, then $ax^2$ is another polynomial that carries $B$ to $0$. And it has the same degree as $x^2$. We only want to talk about one minimal polynomial, not a whole family. So we pick the one whose leading coefficient is $1$. That is, the minimal polynomial will always lead off with just $x^m$, not $ax^m$ for some number $a \ne 1$. It is just a matter of choice.
If you somehow find a polynomial whose leading coefficient isn't $1$, divide by the leading coefficient. For example, if I find that $2A^2 -4A + 2 = 0$, I can divide through by $2$ to get $A^2 - 2A + 1 = 0$. That would be the minimal polynomial (provided $A$ doesn't also satisfy a degree 1 polynomial equation).