Can the following relations be considered functions? 
*

*$f: R \rightarrow R$  where $f = \{(x, \sqrt{x})\mid x \in R \}$ 

*$f: R \rightarrow R$  where $f = \{(x, \tan{x})\mid x \in R\}.$
I believe the $1^{\text{st}}$ one would be considered a function despite negative $R$ values not giving real roots. We can just define the domain to be non-negative.
For the second, in case of some domain values, $f(x)$ would exist but would be infinite. Therefore, it would be considered a function too despite not having a well-defined set of $(x, f(x)).$
I would like someone to verify if my approach is correct.
 A: A function must be defined on every element of its domain, meaning the image of each element of the domain must lie in the codomain.  Assuming $R$ is meant to be the set $\mathbb{R}$ of all real numbers, that is not the case here.
Since the square root of a negative number is an imaginary number, $f(-1)$ is not a real number (never mind the issue of how to define what $\sqrt{-1}$ means).  Hence, we cannot define a function $f: \mathbb{R} \to \mathbb{R}$ by $f = \{(x, \sqrt{x}) \mid x \in \mathbb{R}\}$.  To ensure that $f$ were a function, we would have to restrict the domain to $[0, \infty)$.
The tangent of a real number $x$ is defined by
$$\tan x = \frac{\sin x}{\cos x}$$
for each $x \in \mathbb{R}$ such that $\cos x \neq 0$.  However, $\cos x = 0$ whenever
$$x = \frac{\pi}{2} + n\pi, n \in \mathbb{Z}$$
Thus, $f: \mathbb{R} \to \mathbb{R}$ defined by $f = \{(x, \tan x) \mid x \in \mathbb{R}\}$ is not a function since it is not defined at those values of $x$ where $\cos x = 0$.  In this case, to define a function, we would have to restrict the domain to those values of $x \in \mathbb{R}$ where $\cos x \neq 0$.
