Need help findind function such as $f(a) = c$ and $f(c) = a$ I haven't practiced algebra for ages and it seems I have issues with basic algebraic problem. So I need to find a function such as $f(a) = c$ and $f(c) = a$
As I understand we can do it with the function of a line. E.g
$$ c = ma + b$$ 
$$ a = mc + b$$
But now I am confused on what to do next. I need to solve for $m$ and $b$ right?
$$c - a = ma - mc$$
$$c - a = m(a - c)$$
$$m = \frac{c - a}{a - c}$$
And then $b$
$$c = \frac{c - a}{a - c} \times a + b$$
$$b = c - \frac{c - a}{a - c} \times a$$
And now I am stuck. What should I do next?
 A: This problem is solvable without any fancy algebra. Is there something wrong with
$$f(x)=a+c-x$$
or perhaps, if $a$ and $c$ are non-zero,
$$f(x)=\frac{ac}x$$
?

Here's one way to find a suitable linear function with algebra:
Substituting the expression for $c$ in $c=ma+b$ into the equation $a=mc+b$ we get
$$\begin{align}
a &= m(ma+b)+b \\
a &= m^2a+mb+b \\
0 &= (m^2-1)a+(m+1)b
\end{align}$$
Remember that $a$ is the unknown variable here, so the right-hand side is a polynomial in $a$. For that equation to hold for all $a$, the coefficients must be zero and we must have
$$m^2-1=0 \qquad\text{and}\qquad (m+1)b=0$$
Solving the first gives $m=\pm 1$. If $m=1$ then the second gives $b=0$, so the function is $f(x)=x$. This does not work and is an extraneous solution.
If $m=-1$ then any $b$ will satisfy the second. We get the function $f(x)=-x+b$, and substituting $x=a,f(a)=c$ or $x=c,f(c)=a$ shows that $b=a+c$, giving us the final answer

$$f(x)=-x+a+c$$

which is the same solution I gave earlier.
A: $$f(x)=c \frac{x-c}{a-c}+a \frac{x-a}{c-a}$$ should do the job.
You're right that a linear function will work. But then you should look at a general linear function $y=ux+v$ and write $$\begin{cases} c=ua+v\\
a=uc+v
\end{cases}$$ and solve the system to find $(u,v)$.
A: Well... If your trying to find $f(c)=x, f(x)=c$, then we have:$$f(c)=x$$$$c=f^{-1}(x), c=f(x)$$$$f^{-1}(x)=f(x)$$This means $f(x)$ and its inverse are both the same.  This $f(x)$ could be anything.  In particular, note that when drawing a line along $g(x)=x$ and reflecting $f(x)$ across that line, nothing happens.  Also, the simplest answer to your question is $f(x)=x$.  Other solutions might include$$e^{ln(x+a)}-a$$$$\sqrt{x^2+a}-a$$
or even
-------$$g(f(f^{-1}(g^{-1}(x))$$Which is why I say you should just leave it at $f(x)=x$.
Further more, looking upon linear functions, the following solution is noted:$$f(x)=-x+b,$$where $b$ is any number.  This is because flipping this across $g(x)=x)$ results in the same solution.
A second linear function is also noted, as $f(x)=x$ is the line of reflection and therefore doesn't change after you reflect it.
I recommend looking at most of this stuff visually in a graphing calculator if you want to see the cool flippings and stuff.  Desmos Graphing Calculator is cool because you can switch your x and y variables most of the time and it will redo the graph for you.  If switching the x and y variables yields the same image, then that function is a possible solution to your questions.
