I would like to use the figure in this post showing the geometry of the correlation coefficients. I am currently writing a book and would like to include this figure. How do I obtain permission to use this figure and how do I then cite the figure?
The figure in the post was uploaded on 23 December 2014, so per the StackExchange Terms of Service it is licensed under the terms of CC BY-SA-3.0 (see licensing information in Help Centre). This license is a creative commons share-alike license which allows you to copy and redistribute the material in any medium or format, and remix, transform, and build upon the material for any purpose, including a commercial purpose.
There are some requirements in the license: you must give appropriate credit for the figure (a proper citation should accomplish this) and if you remix, transform, or build upon the material, you must indicate that you made changes to it and distribute your contributions under the same license as the original figure. (I would presume that this would only require any alteration to the figure to be licensed in this way, not your whole book; read the details of the license to be sure.)
In terms of citation, the style depends on the citation style for images you are using in your book. Irrespective of style, your citation should include the author's name (or alias if the true name cannot be established) and the URL of the post. The citation should make it clear that the image was posted on CrossValidated. This will ensure that both the author and StackExchange are given appropriate credit for the image.