I don't know the French education system but it would be very shocking to me if the discriminant is taught when factoring is first taught. Factoring x^3 - y^3 does not have anything to do with the discriminant and x^3 - y^3 is typically taught when factoring is first introduced. At least in the U.S.
In the integers, 1 and -1 are units. So 7 is prime even though it can be "factored" as 7 = 7(-1)(-1) or 7 = (7)(1). Likewise, 4n^2 + 4n + 2 is prime, even though it can be "factored" as (2)(2n^2 + 2n + 1).
Also, your method of substituting a variable is suspect. Being irreducible is a property of a particular polynomial; if you substitute a different expression for x and simplify, you have a different polynomial. Your argument is like saying, "7 is prime, but if you add three to it, it becomes 10 which isn't prime, how can this be?" -- you did something to the number 7 which turned it into a different number, so it should be no surprise that its properties may have changed in the process.
If you want to know about polynomial factorization over various fields, any good abstract algebra textbook should discuss the topic at great length.
What do you mean x^2+1 is prime ? For me prime only applies to integers or do I miss another way this word is used ?