Is there a direct proof for there is no rational number whose square is 2? One of my math teacher did not like proof by contradiction. He mentioned that it is a indirect way to prove something and not a genuine way to prove a statement.
In elementary math class, there is a following statement: "there is no rational number whose square is 2." I have only seen a proof by contradiction so far.
Is there a direct proof for there is no rational number whose square is 2?
Also I want to hear your opinion about proof method: proof by contradiction. Is this really bad? Should I avoid using this method whenever possible?
 A: I will not answer the question about the possibility of providing a direct proof of the irrationality of $\sqrt2$ since that has been asked (and answered) before.
However, concerning the other question, that's easy: there is nothing bad in proofs by contradiction. Real mathematicians do them all the time. And a proof by contradiction is a real proof.
A: I'm going to agree with others that a proof by contradiction is completely valid, assuming mainstream, classical logic.
That said, if either option is available, a direct proof can often be more explanatory, easier to read, more understandable, and possibly more useful in pointing to other constructed facts later on. Many of us find that students tend to go to proofs by contradiction almost fetishistically, when a direct proof is available and shorter. So some of us try to advise students about that blind spot. It's possible that the OP's instructor was trying to say something similar, and was misunderstood.
Now, here's the thing I really want to add. Consider the standard definitions of the terms "rational" and "irrational".

*

*Rational: A real number $r$ is rational if $r = p/q$, for some integers $p$ and $q$, with $q \ne 0$.

*Irrational: A real number is irrational if it is not rational.

The thing I'd like to draw attention to is that the definition of "rational" has a formula for it, whereas "irrational" does not. So proofs about rationality can be done directly, by manipulating that formula algebraically (or manipulating some other formula into a matching form).
With proofs about a number being irrational, that's not an option. It doesn't have a formula; it only has a proposition containing the "not" operator. So really you have no choice but to use a proof by contradiction:  The initial assumption of a negation of your goal statement cancels the other negation, and then you're left with a positive statement about a rational number, for which you have a formula for algebraic manipulation.
So based on the way "irrational" is defined, not-some-other-property, you inherently need to use a proof by contradiction. Again: this assumes standard, classical logic (in which proof by contradiction and "negation" are equivalent).
A: Most people would say there is nothing inherently wrong with proof by contradiction. However in many cases, if a direct proof is available, it may be cleaner and easier to understand than a proof by contradiction.
For instance, a direct proof of the implication $P\Rightarrow Q$ might go
$$
P\Rightarrow A\Rightarrow B\Rightarrow C\Rightarrow Q,$$
where $A$, $B$, and $C$ are intermediate statements. If there is an error somewhere in the proof, someone might catch it with a line of thinking "Assuming $P$ is true: $A$ looks true, $B$ looks true, but $C$ looks false so I should look for the error in the step $B\Rightarrow C$". On the other hand, a proof by contradiction might go
$$
P\text{ and not }Q\Rightarrow A\Rightarrow B\Rightarrow C\Rightarrow \text{contradiction}.
$$
Now, the statements $A$, $B$, and $C$ are all contradictory, so it can be harder to catch a mistake.
An additional reason your teacher may have said this: this is sometimes a tendency for students first learning about proof techniques to overuse proof by contradiction. Many times I have seen student proofs along the lines "Assume $P$ and not $Q$. Then $P\Rightarrow A\Rightarrow B\Rightarrow Q$, which contradicts the assumption that $Q$ is false. Therefore $P\Rightarrow Q$." This is really a direct proof disguised as proof by contradiction, and it is certainly preferable to write is as a direct proof.
A: As another answer indicated, proof by contradiction is really only objected to by constructivist mathematicians, who use intuitionistic logic. But typically constructivists will accept the usual proof of the irrationality of $\sqrt 2$. If I'm right in assuming that your professor is a constructivist, then I'd imagine that they would accept that proof. This might be confusing. As you say, the irrationality of $\sqrt 2$ seems like a proof by contradiction, so to explain this I'll explain constructivism to the best of my knowledge first.
In intuitionistic logic, one refuses the law of excluded middle:
$$
P \vee \neg P
$$
which can be thought of as saying that $\neg (\neg P) \iff P$ for all propositions $P$. In case you're unfamiliar with the jargon, $\neg$ means "not" and $\vee$ means "or." Now, a proof by contradiction is something of the form:
$$
\text{Suppose } \neg P \text{ and derive a contradiction. Then, we must have } P.
$$
But there is a very similar proof method called proof by negation that is constructively valid:
$$
\text{Suppose } P \text{ and derive a contradiction. Then, we must have } \neg P.
$$
These appear almost identical (and in classical logic they are identical), but the crux is that proof by contradiction uses the law of excluded middle whereas proof by negation does not. Proof by negation essentially comes from the fact that $\neg P$ is the same as $P \implies \text{false}$. This is often taken as the definition of $\neg P$. From this perspective, proof by negation is an application of the deductive principle that to prove $P \implies \text{false}$, one can suppose $P$ and derive $\text{false}$.
The irrationality of $\sqrt 2$ is a proof by negation, not by contradiction. The proof I'm aware of starts with "Suppose $\sqrt 2 = \frac{p}{q}$..." and ends with "...so $p$ and $q$ must both be even, which is a contradiction. Hence, $\sqrt 2$ is irrational." This is a proof by negation and is therefore constructively valid.
Now, as for proof by contradiction, I personally see no issue with it. I accept the law of excluded middle in my work and don't think twice about using proof by contradiction. I think the majority of mathematicians would agree with me on this. However, constructivism is a very real viewpoint and it's worth understanding it. I can't do it much justice myself, but I highly recommend an article written by Andrej Bauer entitled "5 Stages of Accepting Constructive Mathematics." There are many very technical things in this article, but I think you could still learn a lot about constructivism and why (I assume) your professor dislikes proof by contradiction.
A: The only people who have problems with proof by contradiction are constructivists who don't accept the law of the excluded middle.  In constructivist math,  knowing something is not false is not the same as knowing it's true.   However,  outside of some computer programming and and abstract logic domains,  most mathematicians don't use constructivist math.   This is because we are seriously, seriously hamstrung in our tools.  We can't even use basic things like the intermediate value theorem!
