Existence of algorithm for determining if a given number is rational or not As far as I understand, it is not necessarily a easy thing to prove that a real number is rational or not. For example, according to http://mathworld.wolfram.com/e.html "$e+\pi \in \mathbb{Q}$?" is still an open problem.  
This might be completely nonsense but I'm wondering there is something preventing the existence of a general algorithm which can "decide" whether any real number is rational or not in a finite number of steps?
I'm very much still a beginner in math and I thus for obvious reasons have a hard time reasoning about this question in a meaningful way. If we for the sake of argument assume that such a algorithm exists, would this lead to some contradiction? 
 A: The details of this depend a bit on how you imagine that input number to the algorithm is to be given -- there's no way to represent every real number as a finite combination of symbols that the algorithm can even inspect in a finite time.
However, it seems to be reasonable that if an algorithm such as the one you imagine exists at all, it ought to be able to formulate it such that it accepts input numbers given in the most explicit way imaginable:

Input: A computer program (or description of a Turing machine) that given $n$ produces the $n$th decimal digit of the real number we think about.
Output: "Yes" if the number we think about is rational, "No" otherwise.

One can prove that no algorithm with this input and output can exist. Namely, if it existed we could use it to decide the halting problem, which is known to be undecidable algorithmically.
Suppose we want to know whether Turing machine $T$ halts. We can then consider the real number $x$ whose digit number $n$ is


*

*$0$ is $T$ runs for at least $n$ steps,

*$1$ if $T$ halts in less than $n$ steps and $n$ is a perfect square, or

*$2$ if $T$ halts in less than $n$ steps and $n$ is not a perfect square


It is clear that this is a computable specification of the digits of $x$ -- for each digit we simply simulate $T$ for $n$ steps and see what happens.
Now if $T$ doesn't halt, $x$ will be $0$ -- in particular $x$ is rational. On the other hand, if $T$ does halt, $x$ will consist of a number of $0$s followed by an infinite sequence of $1$s and $2$s which never repeats (because the number of non-squares between successive squares increase monotonically). This, if $T$ halts, $x$ will be irrational.
If your algorithm existed, running it on this $x$ would tell us whether $T$ halts or not. But that is known to be impossible, so the algorithm cannot exist.

We might try to salvage this by requiring that the digits of $x$ must be given in some nicer way than by an unrestricted program that computes its digits. However, that doesn't lead us anywhere nice, because the digits of the number above are defined by a primitive recursive function, which is just about the simplest class of functions that one can argue are expressive enough to compute digits of most "interesting" real numbers, at least unless we cheat and introduce particular notations for "the digits of $e$", "the digits of $\pi$" and so forth for some hand-selected set of interesting constants.
A: Yes, there is an algorithm, the continued fraction expansion only terminates after a finite number of steps if the number is rational. In the case of irrational numbers, this expansion would not terminate, making the algorithm impractical.
Another question is, an algorithm needs an input. How would you encode the number $e+\pi$ for the computer? Any finite approximation already is a rational number.
