Cointegration - same thing as stationary residuals? So I'm aware that cointegration means there is some linear combination of the set of variables that is stationary. So, if you do a regression and find stationary residuals, can you just immediately say "oh, yes these variables are cointegrated" ?  Because you have then just found some linear combination that is stationary?
My concern is the oft cited reasons/bad consequences for why you shouldn't do a regression with trending/undifferenced/non-stationary variables. I won't repeat them here, but the one caveat is always "oh but you can regress these non-stationary variables if they are cointegrated". Is this the same as saying "go ahead and try regressions with any non-stationary variables you want, and if the residuals are stationary you can say, well it was ok to do this regression after all because these variables are cointegrated"?
It just seems too simple, or too good to be true. 
 A: No, this is not true. In order to consider a cointegrating relationship your variables need to be at least integrated of order one, $I\left(1\right)
 $. In order to carry out a cointegration analysis you would first have to conduct a unit root test to see if your time series are in fact $I\left(1\right)
 $. Then you could conduct a cointegration test on the relevant series, some of the more popular being the Johansen trace test/maximum eigenvalue test (estimated using maximum likelihood) or the more robust Engle-Granger method (estimated using OLS). If you only have two variables or only suspect one cointegrating relationship you could use the Engle-Granger while the Johansen test can accommodate several cointegrating relationship.
Consider an economic example: You are interested in testing whether or not the money and output cointegrate. You would first run a/several unit root test/s on the series in order to see whether or not they were in fact $I(1)
 $. If they were in fact $I\left(1\right)
 $ you could test for a cointegrating relationship using the Engle-Granger method since you only have two variables, hence you can at most have one cointegrating vector.
First you would run the regression: $y_{t}=\beta_{0}+\beta_{1}m_{t}+u_{t}
 $, where $\beta_{0}
 $ is a constant, $m_{t}
 $ is money, $y_{t}
 $ is output and $u_{t}
 $ is the error term. After running this regression you would run a unit root test on the residuals to see if they were stationary or $I\left(1\right)
 $. If they are stationary the series cointegrate! What is crucial for cointegration is that the series share a common stochastic trend and that they are at least integrated of order 1. By just regressing one $I\left(1\right)
 $ series on another $I\left(1\right)
 $ series you could end up with a spurious regression if they do not share a common stochastic trend, i.e. cointegrate. You could also deal with the spurious regression problem by including enough lags for each variable of interest when using a dynamic model!
Note that you can have different kinds of non-stationarity. A trend-stationary series which has an upwards trend is non-stationary. By detrending the series or including a time trend you can make these residuals stationary (see the Frisch–Waugh–Lovell theorem) although there is no cointegration present at all. Further, you can have non-stationary series due to level shifts (structural breaks) or sub-samples with differing degree of volatility. You can have an $I\left(1\right)
 $ series which can be made stationary by differencing it once.
Hopefully this answered your question. I would recommend you to read up on stationarity, integration and cointegration.
