<s>[INST] Find a matrix and analytic formula for a linear map $f: \mathbb R^{4} \rightarrow \mathbb R^{3}$ This linear map $f: \mathbb R^{4} \rightarrow \mathbb R^{3}$ meets the conditions:
\begin{align}\newcommand{\ran}{\operatorname{ran}}
f(1,2,3,1) &=(1,3,1) \\
(1,5,4,1) &\in \ker f\\
(1,1,2) &\in \mathrm{im} f \\
(7,5,0) &\in \mathrm{im} f
\end{align}
I think to do this task firstly, I should create a matrix, so I have:
$$
\begin{bmatrix}
1 & 2 & 3 & 1 &
| & 1 & 3 & 1 \\
1 & 5 & 4 & 1 &
| & 0 & 0 & 0\\ 
&  & & & | & 1 & 1 & 2\\
& & & & | & 7 & 5 & 0
\end{bmatrix}
$$
However, I don't know how to use information about $\mathrm{im} f$ so my matrix is incomplete.
 [/INST] $\newcommand{\ran}{\operatorname{ran}}\newcommand{\R}{\mathbb{R}}$I guess you want a matrix which correspond with the linear map with respect to the standard basis.
First of all, let me tell you that you cannot find a unique solution to this exercise. So at some point you have to choose some properties of your solution.
Let $v_1 = \left(\begin{smallmatrix}1 \\ 2\\3 \\ 1\end{smallmatrix}\right)$ and $v_2 = \left(\begin{smallmatrix}1\\5\\4\\1\end{smallmatrix}\right)$.
You have to choose two more vectors $v_3,v_4$, such that $\{v_1,v_2,v_3,v_4\}$ is a basis of $\R^{4}$. One possible choice would be $v_3 = \left(\begin{smallmatrix}0\\0\\1\\ 0\end{smallmatrix}\right)$ and $v_4 = \left(\begin{smallmatrix}0\\0\\0\\ 1\end{smallmatrix}\right)$. Then you choose that $f$ maps
$$
v_3 \mapsto \left(\begin{smallmatrix}1\\1\\2\end{smallmatrix}\right), \quad
v_4 \mapsto \left(\begin{smallmatrix}7\\5\\0\end{smallmatrix}\right).
$$
Now you just have to calculate the image of $e_1 (=\left(\begin{smallmatrix}1\\0\\0\\0\end{smallmatrix}\right))$ and $e_2 (=\left(\begin{smallmatrix}0\\1\\0\\0\end{smallmatrix}\right))$.
\begin{align}
\left(\begin{matrix}
1 & 1 & 0 & 0 \\
2 & 5 & 0 & 0 \\
3 & 4 & 1 & 0 \\
1 & 1 & 0 & 1 \\
\hline
1 & 0 & 1 & 7 \\
3 & 0 & 1 & 5 \\
1 & 0 & 2 & 0 \\
\end{matrix}\right)
\rightsquigarrow \text{many elementary steps} \rightsquigarrow
\left(\begin{matrix}
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 \\
0 & 0 & 1 & 0 \\
0 & 0 & 0 & 1 \\
\hline
-\frac{23}{3} & -\frac{2}{3} & 1 & 7 \\
-\frac{7}{3} & -\frac{4}{3} & 1 & 5 \\
-3 & -1 & 2 & 0 \\
\end{matrix}\right)
\end{align}
Therefore, the matrix which represents your linear mapping $f$ is
$$
\left(
\begin{matrix}
-\frac{23}{3} & -\frac{2}{3} & 1 & 7 \\
-\frac{7}{3} & -\frac{4}{3} & 1 & 5 \\
-3 & -1 & 2 & 0 \\
\end{matrix}\right).
$$
</s>