Is it possible to predict $x^2$, $\log(x)$, or variable function of $x$ using RNN?
Yes, RNN can work on the functions you have mentioned. In fact, neural networks can approximate anything (Universal Approximation Theorem). This question also reminds me of Neural Turing Machine.
But, it would be a complete waste to use RNNs or NNs for such a task.